Dynamic action - Cache server data

APEX 4.2.2
Is there a way to cache server side data in a global (page/document level) Javascript vector (bunch of key-value pairs) (associative array, array of objects or some such)? This way the data can be used by subsequent dynamic actions' Javascript code without querying the server over and over.
I see that apex_util.json_from_sql is still undocumented after all these years. Are there any examples of using that API to do this sort of thing? Can someone please share?
Thanks

https://apex.oracle.com/pls/apex/f?p=57688:24
I took a shot at this and it seems to work well using Javascript global objects for data storage. Hope this helps someone.
1. Page attributes - Javascript global variables var gData,gLookup={};2. On-demand application process Get_Emps as apex_util.json_from_sql('select empno,ename from emp');3. Page Load dynamic action to invoke the application process and cache the data var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=Get_Emps',$v('pFlowStepId'));
var retval=get.get();get=null;
gData=apex.jQuery.parseJSON(retval);
$.each(gData.row,function(i,obj){
   gLookup[obj.EMPNO]=obj.ENAME;
});4. EMPNO page item - Standard OnChange dynamic action to SetValue of ENAME page item using the cached data - Javascript expression gLookup[$v(this.triggeringElement)]
We document something when it is ready to be supported. This specific procedure isn't something we haven't invested in, and thus, per our discretion, have elected not to document or support it at this time.Fair enough.

Similar Messages

  • Dynamic action defalting IT0041 date specification

    Hi., Every one
    I am strucking up bringing default values to date specification (IT0041).
    Requirement: Based on the Hiring date (ex: 1.1.2007) system should calcuate (adding 6months) the other date specification and should default in the date field.
    If the Hiring date is 1.1.2007 system should default 1.7.2007 (adding 6 months) in the date specification field.
    My configuration follows below:
    0000                   04     332     P     T001P-MOLGA='40'
    0000                   04     334     P     P0000-MASSN='I1'
    0000                   04     338     I     INS,0019,Z0
    0000                   04     339     W     P0019-TERMN=P0000-BEGDA
    0000                   04     340     W     P0019-VTRAN='6'
    0000                   04     341     W     P0019-VTRZH='012'
    0000                   04     345     W     P0019-VTROP='+'
    0000                   04     350     I     INS,0041,,,(P0000-BEGDA),(P0000-ENDDA)
    0000                   04     352     W     P0041-DAR05='Z0'
    0000                   04     354     W     P0041-DAT05=P0019-TERMN
    I tried storing the value (1.7.2007) in IT0019, and tried default that value in IT0041 date specification., but its not working in that way..
    Would appreciate your help., if any one fix this problem.
    Madhu. K

    Hi
    Its very much possible i have done it in my earlier company you have to take the help of the abaper and guide him with your Actions codes and the day type codes.
    Award points if helpful
    Regards,
    Bhupesh Wankar

  • Dynamic Action On Date Picker

    Hi,
    I need help with understanding dynamic actions. I have two date pickers, I want the value of the first date picker to be the minimum date of the second date picker. To achieve this I have a hidden item whose value I want to reflect the selected date in the required format. In the dynamic action on the date picker I have no condition, and the true action is set to execute the following pl/sql code
    :P200220000_Y_MIN_DT := TO_CHAR(TO_DATE(:P200220000_Y_STR, 'DD-MON-YYYY'), 'YYYYMMDDHH24MI');. The items to submit field contains both the first date picker and the hidden item.
    The "P200220000_Y_MIN_DT" is now passed into the minimum date field of the second date picker. The problem is when the date is changed the hidden item does not get the value until the page is refreshed.
    Am I doing something wrong or just have not mastered the use of dynamic action or are my colleagues right use AJX call backs not dynamic actions.
    Thanks
    Aderemi

    Hi Aderemi,
    first of all as already explained, the min/max values are already used on the server side when the necessary code for the date picker is rendered. When you changed the referenced values in the browser, these values will not change the behavior of the client side date picker widget. But when you submit the page, the new min/max values will be used by the date picker validation check on the server.
    To over the client side date picker display issue, you could directly call the date picker JavaScript code and pass in the new min/max values. Have a look at http://jqueryui.com/demos/datepicker/
    So for example you could have a dynamic action of type "Execute JavaScript code" which executes the following Javascript code.
    apex.jQuery('#P200220000_MY_DATE_PICKER').datepicker("option", "minDate", "-1m");I think that should work. Note: I haven't tested if that really works and it's also some kind of unsupported, because it uses the underlaying jQueryUI APIs the APEX date picker is using. This could change in the future and would invalidate your code.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins

  • Problem in calling dynamic actions in BDC

    Dear All,
    I have created a subroutine which is called when an entry is made in IT0015 for a particular wagetype. So I have used dynamic actions to serve the purpose.
    But the entries in IT0015 are made through a BDC, and I am facing in calling dynamic actions through BDC. I have tried the following code:
    DATA: opt TYPE ctu_params .
    DATA: zmode TYPE c VALUE 'N',
    zupd TYPE c VALUE 'A'.
    opt-dismode = zmode.
    opt-updmode = zupd.
    opt-defsize = 'X'.
    opt-nobinpt = 'X'.
    ******While calling transaction in BDC
    CALL TRANSACTION 'PA40' USING g_t_bdc
    OPTIONS FROM opt
    MESSAGES INTO g_t_messtab.
    But this does not work, it only calls the first screen of tcode PA30 and only populates the PERNR in that.
    Please suggest how do I rectify this problem.
    Regards,
    Kanupriya

    Hi Marcin,
    When I call PA30 without using options i.e.:
    CALL TRANSACTION 'PA30' USING BDCDATA MODE 'A' UPDATE 'S'.
    then, the BDC works perfectly and calls all the required screens correctly.
    But when I use:
    CALL TRANSACTION 'PA30' USING bdcdata
    OPTIONS FROM opt
    MESSAGES INTO messtab.
    then, it shows me only the first screen of PA30 and stops there.
    Also, if I hard code a break-point in my subroutine and save an entry in PA30, then the subroutine stops at the breakpoint. But if I call PA30 with SHDB transaction, then the code does not stop at subroutine which means the subroutine is not being called with SHDB.
    Please suggest why this is occuring.
    Regards,
    Kanupriya

  • Dynamic action in infotype0000

    hi abapers
    I am using HR_MAINTAIN_MASTERDATA Fm to update 0000 infotype. can i use Dynamic action to update data of other infotypes?
    thanks
    Sachin

    hi Kumar Bandanadham
    by filling proposed values...then there will not be any dynamic action. the meaning of dynamic action will lost. Is it possible to have dynamic action when i am using Fm HR_MAINTAIN_MASTERDATA?
    thanks
    Sachin

  • Dynamic action with set value on date field

    Hi,
    I'm using APEX 4.02
    I'm trying to calculate the age based on the date of birth dynamically on a form. I'm trying to do this with a (advanced)dynamic action with set value.
    I'm able to get this kind of action working based on a number field etc, but NEVER on a date field.
    I've read all posts on this subject but so far no solution. Even if I try to simply copy the value over to another date field or typecast it to a string ( to_char function ) it does not work. So for me the problem seems to be in the source field being a date field.
    I've tried using the source value as is in a select statement :
    select :P33_GEBOORTEDATUM from dual;
    and also type casted based on the date format :
    select TO_DATE(:P33_GEBOORTEDATUM,'DD-MON-YYYY') from dual
    but still no luck.
    On the same form I don't have any issues as long as the calculation is based on number fields, but as soon as I start using dates all goes wrong.
    Any suggestions would be greatly appreciated. If you need any extra info just let me know.
    Cheers
    Bas
    b.t.w My application default date format is DD-MON-YYYY, maybe this has something to do with the issue .... ?
    Edited by: user3338841 on 3-apr-2011 7:33

    Hi,
    Create a dynamic action named "set age" with following values.
    Event: Change
    Selection Type: Item(s)
    Item(s): P1_DATE_OF_BIRTH
    Action: Set value
    Fire on page load: TRUE
    Set Type: PL/SQL Expression
    PL/SQL Expression: ROUND( (SYSDATE - :P1_DATE_OF_BIRTH)/365.24,0)
    Page items to submit: P1_DATE_OF_BIRTH
    Selection Type: Item(s)
    Item(s): P1_AGE
    Regards,
    Kartik Patel
    http://patelkartik.blogspot.com/
    http://apex.oracle.com/pls/apex/f?p=9904351712:1

  • Date Picker with Dynamic Action

    Hi
    I have a situation where a DA is fired onchange of a date field using the apex 4 date picker item type.
    The DA does a number of calculations and database requests, so it can take a few seconds over our slow internet connection.
    While the DA is executing, the calendar remains displayed. The application demands that I display at least 1 or preferably 2 months as well as the current month to facilitate the user entry, which means much of the page is obscured. Not only would it be nice so see the various fields in multiple regions being updated progressively, it would also be reassuring for the user to see that the application has not "hung".
    Is this the expected behavior? Is there a technique to close the date picker before the DA actions are triggered?
    Thanks for your advice.
    CS

    Hi,
    Try this write a Zprogram for this.
    REPORT  Zget_date.
    TABLES : RP50D, PA0041, P0041, PA0019.
    PERFORM Z_date.                       "3CML Dynamic action for IT0000
    FORM Z_date.
      DATA: DATE1 LIKE SY-DATUM.
      DATA: DATE2 LIKE SY-DATUM.
      SELECT * FROM  PA0041
               WHERE  DAR01 EQ '11'
                AND PERNR  = P0041-PERNR
                AND BEGDA  = P0041-BEGDA.
        DATE1 =  PA0041-DAT01.
        DATE2 = DATE1 + 1.
        RP50D-DATE1 = DATE2.
        EXIT.
      ENDSELECT.
    ENDFORM.       
    and use this in your dynamic action.
    F Z_date(Zget_date)
    W P0041-DAT01=RP50D-DATE2
    Hope this will solve your problem.
    Regards,
    ARU

  • ADC exception=BAM-01262: Active Data Cache server exception in openViewset

    Hi All,
    I am getting the below mentioned error when i try to open a report from Active Studio in BAM.
    If i give parameter value ' All ' in the prompt, it shows all the value. But if i give specific values like one parameter value 1007 and other All etc, it gives the below error. I tried giving parameter value ' All ' in the prompt after getting the error, its not showing the values.
    The below error is from front end:-
    SQL EXCEPTION NULL : Invalid column index
    The below error from back end:-
    [2012-01-10T06:39:07.916+05:30] [bam_server1] [ERROR] [] [oracle.bam.reportcache] [tid: [ACTIVE].ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: weblogic] [ecid: 83cdf926093045b8:4fde7fa7:134bf505061:-8000-00000000000044f4,0] [APP: oracle-bam#11.1.1] *ReportCache: ReportCacheServer.OpenViewSet: ADC exception=BAM-01262: Active Data Cache server exception in openViewset(). [[*
    at oracle.bam.adc.kernel.util.Util.getCacheException(Util.java:101)
    at oracle.bam.adc.kernel.util.Util.getCacheException(Util.java:154)
    at oracle.bam.adc.kernel.util.Util.getCacheException(Util.java:172)
    at oracle.bam.adc.kernel.server.DataStoreServer.openViewset(DataStoreServer.java:1110)
    at oracle.bam.adc.ejb.BamAdcServerBean.openViewset(BamAdcServerBean.java:841)
    at sun.reflect.GeneratedMethodAccessor702.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
    at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at com.bea.core.repackaged.springframework.jee.intercept.MethodInvocationInvocationContext.proceed(MethodInvocationInvocationContext.java:104)
    at oracle.bam.adc.ejb.BamAdcServerBean.interceptor(BamAdcServerBean.java:266)
    at sun.reflect.GeneratedMethodAccessor374.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    [2012-01-10T06:39:07.913+05:30] [bam_server1] [ERROR] [] [oracle.bam.adc] [tid: [ACTIVE].ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] [userId: weblogic] [ecid: 83cdf926093045b8:4fde7fa7:134bf505061:-8000-00000000000044f4,0] [APP: oracle-bam#11.1.1] ActiveDataCache: Exception occurred in method openViewset(_TPT_PO_HEADER_STG_TBL,0)[[
    Exception: java.sql.SQLException: SQLError(17003) SQLState(99999) Invalid column index
    at oracle.jdbc.driver.OraclePreparedStatement.setStringInternal(OraclePreparedStatement.java:6336)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:10605)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:10518)
    at oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:11574)
    at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedStatement.java:11544)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.setObject(OraclePreparedStatementWrapper.java:249)
    at oracle.bam.adc.common.externaldatasources.JDBC.getDataReader(JDBC.java:322)
    at oracle.bam.adc.kernel.datasets.ExternalStorageEngine.getDataReader(ExternalStorageEngine.java:76)
    at oracle.bam.adc.kernel.viewsets.utilities.externaldata.DataImporter.executeQuery(DataImporter.java:95)
    at oracle.bam.adc.kernel.viewsets.utilities.externaldata.ExternalDataManager.importExternalData(ExternalDataManager.java:228)
    at oracle.bam.adc.kernel.viewsets.utilities.externaldata.ExternalDataManager.importExternalFactData(ExternalDataManager.java:151)
    at oracle.bam.adc.kernel.viewsets.utilities.externaldata.ExternalDataManager.getExternalData(ExternalDataManager.java:103)
    at oracle.bam.adc.kernel.viewsets.Viewset.loadData(Viewset.java:259)
    at oracle.bam.adc.kernel.viewsets.ViewsetBase.initialize(ViewsetBase.java:171)
    at oracle.bam.adc.kernel.viewsets.Viewset.initialize(Viewset.java:220)
    at oracle.bam.adc.kernel.viewsets.ViewsetBase.open(ViewsetBase.java:154)
    Please give me any suggestion on this.
    Thanks,
    Manikandan

    This problem was solved when I installed a new product version.

  • Client automatically cache the data got from cache server?

    Hi expert,
    I have 2 questions about the client local cache. Would you please help to give me some suggestion?
    1. Will client automatically locally cache the data got from cache server the first time and automatically update the data in local cache when getting the same data from cache server again? I go through the API reference but cannot find any API to query the data currently cached in the local cache.
    2. If client will automatically cache the data got from cache server. Is there any way for a client to get the data event that happens to its local cache, such as entry created in local cache, entry deleted from local cache and entry updated in local cache? In my opinion, when getting an entry from cache server the first time, the MapListener's entry create event should be triggered. When getting the same entry again, the entry update event should be triggered.
    However, I have tried a client with replicated cache, a client with partitioned cache, an extend client with remote cache and a client with local cache(front cache part of near cache), the client (the NamedCache object has been set the MapListener) cannot get any event notification after getting data from cache server. By the way, my listener is OK since when putting data the entry create event and entry update event will be triggered.
    Your suggestion is very appreciated. :)

    Hi
    If I were you I would read this http://download.oracle.com/docs/cd/E14526_01/coh.350/e14510/toc.htm
    and particularly the section about Near Caching here http://download.oracle.com/docs/cd/E14526_01/coh.350/e14510/nearcache.htm#CDEFEAJG
    which is what you are asking about in your question.
    Near Caching is how Coherence stores data in the locally - which is the answetr to your first question. How Near Caching works is explained in the documentation.
    Events, which you ask about in your second question are explained here http://download.oracle.com/docs/cd/E14526_01/coh.350/e14510/delivereventsjava.htm#CBBIIEFA
    It might be that ContinuousQueryCache is closer to what you want. This is explained here http://download.oracle.com/docs/cd/E14526_01/coh.350/e14510/queryabledatafabric.htm#sthref38 A ContinuousQueryCache is like having a sub-set of the underlying cache on the local client which you can then listen to etc...
    JK

  • Adding period to a date in Dynamic action

    Hi Gurus,
    We have a requirement where we need to create a IT2010 with a start date less than the action date.
    For E.g If action is run on 02.07.2011 then IT 2010 should be created with 01.07.2011.
    Please help.

    Create program that can be called as a routine in Dynamic Action (table V_T588Z)
    1.    Within the dynamic action, the routine (ZXXXX) will be called (Configured by the functional consultant) with the GETDATE subroutine:
    P2010-BEGDA=RP50D-DATE1
    2.     In the program, we need to minus 1 from the hire date.
    Program     ZXXXX
    Tables : P0000, rp50d
    Form getdate
          Rp50d-date1 = p0000-begda u2013 1
    Endform

  • Get infotype data in e-mail/sapscript - Dynamic action-

    Hello,
    we developed a dynamic action sending a mail if an employee leave the company.
    We can catch data in infotype 0000 and 0001 in the sapscript used in the mail, but we would like also fetch data from other infotypes.
    We tried to generate an ABAP code from an ad hoc query, but it was impossible to get the return tables in the sapscript.
    Are there other solutions to get infotype data in saps scripts?
    Kr,

    Hi ,
    you can follow the below solution .
    1. Create a custom report for the leaving/terminated employees by using the action in infotype 0000 with field massn, massg.
    2. you will get all the employees from table pa0000 who are laving between a date interval .
    3. by using the personnel numbers from pa0000 get other infotypes information.
    4. create a smartform/script for your requirement.
    5. using the program you can send the data to the employees.
    another way .
    if you know the name of the script you can create some variables for the other fields from other infotypes in that script and you can populate the variable values using perform in program command using a custom program in that script.

  • Dynamic Actions not firing when using date picker?

    The dynamic actions don't seem to be triggering when selecting a date from the date picker, but trigger just fine when the dates are manually entered. Anyone else have this problem and if so is there a workaround to get it to work from the date picker as well? I am using Application Express 4.0.1.00.03
    And how can I report this problem?

    I'm already using Change.
    If it matters, I have it set to:
    Event: Select
    Selection Type: Item
    Condition: No Condition
    My action type is just an alert right now since all I want to do is to see if I can trigger it (as in you have to walk before you can run).
    Event Scope: Live
    Conditon type: Dynamic Action not Conditional
    Authorization Scheme: No Authorization Required

  • Stale Near Cache data when all Cache Server fails and are restarted

    Hi,
    We are currently making use of Coherence 3.6.1. We are seeing an issue. The following is the scenario:
    - caching servers and proxy server are all restarted.
    - one of the cache say "TestCache" is bulk loaded with some data (e.g. key/value of : key1/value1, key2/value, key3/value3) on the caching servers.
    - near cache client connects onto the server cluster via the Extend Proxy Server.
    - near cache client is primed with all data from the cache server "TestCache". Hence, near cache client now has all key/values locally (i.e. key1/value1, key2/value, key3/value3).
    - all caching servers in the cluster is down, but the extend proxy server is ok.
    - all cache server in the cluster comes back up.
    - we reload all cache data into "TestCache" on the cache server, but this time it only has key/value of : key1/value1, key2/value.
    - So the caching server's state for "TestCache" is that it should only have key1/value1, key2/value, but the near cache client still thinks it's got key1/value1, key2/value, key3/value3. So in effect, it still knows about key3/value3 which no longer exists.
    Is there anyway for the near cache client to invalidate the key3/value3 automatically? This scenario happens because the extend proxy server is actually not down, but all caching servers are, but the near cache client for some reason doesn't know about this and does not invalidate the cache client near cache data.
    Can anyone help?
    Thanks
    Regards
    Wilson.

    Hi,
    I do have the invalidation strategy as "ALL". Remember this cache client is connected via the Extend proxy server where it's connectivity is still ok, just the caching server holding the storage data in the cluster are all down.
    Please let me know why else we can try.
    Thanks
    Regards
    Wilson.

  • Concatenating data for field assignment in Dynamic Action

    In a dynamic action I am creating a record in a custom infotype.  In one of the custom infotype fields I need to assign a value of the number 28 concatenated with the personnel number.  The line in the dynamic action is
    W P9007-Z_INS_EE_PK = '28'&Pernr but the problem is I cannot get a concatenation to work.  How do you go about concatenating data together in a field assignment?

    Hi David,
    For this, you will have to write a small routine in a program and then call it in the dynamic action. Consult your technical team on this. Get them to write a routine which would concatenate the value and pass it to field RP50D-FIELD1. You would then call the routine and default the fields as shown below:
    F ZPROGRAM(Z_CONCATENATE)
    I INS,9007,,,
    W P9007-Z_INS_EE_PK=RP50D-FIELD1
    Here, ZPROGRAM is the name of the program and Z_CONCATENATE is the routine which would contain the logic to populate field RP50D-FIELD1 with concatenated value.
    Donnie

  • Row action event on data table does not occur when rows added dynamically

    Row action event on data table does not occur (only refreshes the page) when the rows in the data table are added dynamically at run time using button click and java bean.
    please tell me a way to catch the row click event when adding rows dynamically to data table. i m using RAD 6.0 to develop Faces jsp pages.
    thanks
    amit

    i got the answer

Maybe you are looking for