Passing Values to and from a Javascript rule - Agentry

Hi;
I am working on determining the first day and last day of the week using a javascript rule, so this can be in turn passed to an Agentry date and time property. When I debug in the ATE, it seems my javascript rule is always returning zero. What could I be missing, please see below the rule implementation. I am using this rule on a transaction property, under the "Initial Value" attribute - before data entry:
What could my rule be missing, How could I implement this correctly?
Much appreciated!
Sizo Ndlovu
Tags edited by: Michael Appleby

Hi Stephen;
I have done as you advised, but I seem to be still getting a zero returned, please see below:
The Javascript method return variable (curUnixTime -: as shown on the first screenshot), is it automatically returned onto the WeekEnd property or there is extra code/steps that I need to add?
Thanks and Regards;
Sizo Ndlovu

Similar Messages

  • Passing values to and from Excel

    All,
    I am building a program to gather data from a force gauge via RS232. One of the requirements of the program is to have the user tell the program what sample they are on in case their samples are not in order. I also need to check my Excel sheet if that sample has already been tested. Some of my code in a module looks like this:
    Function HasSampleBeenTested(dblSample As Double, strSG As String) As Boolean
    ' Finds out if the sample being tested has already been tested.
    HasSampleBeenTested = False
    Range("B14").Select
    'First, find the Sample Group Number
    Do Until ActiveCell.Value = ""
        If ActiveCell.Value = strSG Then
            ActiveCell.Offset(0, -1).Select
            Exit Do
        Else
            ActiveCell.Offset(1, 0).Select
        End If
    Loop
    ' Next, find the actual sample
    Do Until ActiveCell.Value = ""
        If ActiveCell.Value = strSample And ActiveCell.Offset(0, 1).Value = strSG Then
            HasSampleBeenTested = True
            Exit Do
        Else
            ActiveCell.Offset(1, 0).Select
        End If
    Loop
    End Function
    I also have a diagram wired to this exact instance of Excel, but I'm not sure how to wire my type (boolean) and get the data out as a boolean via the Variant to Data VI.
    Solved!
    Go to Solution.
    Attachments:
    Diagram1.png ‏6 KB

    There is no reason to actually have an Insert Into Array. The Build Array already gives you an array. The Excel Run Macro actually wants an array of variants, not an array of strings. The red coercion dot indicates that your array of strings is being converted to an array of variants. I'm not sure if the macro will actually received the Sample # correctly since you're converting it to a string. The safe bet would be to convert each value to a variant (using the To Variant function) and build an array from that to feed to the Excel Run Macro:
    Attachments:
    Example_VI_BD.png ‏2 KB

  • B2B-51507 An Error was reported from a Javascript rule

    Hi All,
    I am not able to process EDI dat file with validate option enabled at the agreement level. Please see the below error message, please suggest!
    <?xml version="1.0" encoding="UTF-8" ?><ns1:Exception xmlns:ns1="http://integration.oracle.com/B2B/Exception" xmlns="http://integration.oracle.com/B2B/Exception">
       <ns1:correlationId>null</ns1:correlationId>
       <ns1:b2bMessageId>0A523743140086685E200000497F6962-1</ns1:b2bMessageId>
       <ns1:errorCode>B2B-51507</ns1:errorCode>
       <ns1:errorText>
      An error was reported from a JavaScript rule.
      </ns1:errorText>
       <ns1:errorDescription>
      Machine Info: (XXXXXXXXXXXX)
    The external code list 881 effective on date 07/18/2013 was not found.{br}{br}This error was detected at:{br}{tab}Element Count: 8{br}{tab}Characters: 159 through 171
      </ns1:errorDescription>
       <ns1:errorSeverity>2</ns1:errorSeverity>
       <ns1:errorDetails>
          <ns1:parameter name="AckParentReject" value="T"/>
          <ns1:parameter name="GroupReceiverID" value="XXXXXXXXXXXX"/>
          <ns1:parameter name="TransactionImplementationReference" value="005010X220A1"/>
          <ns1:parameter name="TransactionChildCount" value="296"/>
          <ns1:parameter name="InterchangeReceiverQual" value="ZZ"/>
          <ns1:parameter name="InterchangeChildCount" value="1"/>
          <ns1:parameter name="InterchangeControlVersion" value="00501"/>
          <ns1:parameter name="ActionCode" value="2"/>
          <ns1:parameter name="GroupID" value="BE"/>
          <ns1:parameter name="SubelementDelimiter" value="\"/>
          <ns1:parameter name="InterchangeSenderQual" value="ZZ"/>
          <ns1:parameter name="InterchangeUsageIndicator" value="P"/>
          <ns1:parameter name="GroupChildCount" value="1"/>
          <ns1:parameter name="InterchangeSenderID" value="888888888888888"/>
          <ns1:parameter name="InterchangeControlNumber" value="000000001"/>
          <ns1:parameter name="Standard" value="X12"/>
          <ns1:parameter name="InterchangeTime" value="1127"/>
          <ns1:parameter name="RepeatingSeparator" value="^"/>
          <ns1:parameter name="GroupVersionNumber" value="005010X220A1"/>
          <ns1:parameter name="InterchangeDate" value="130718"/>
          <ns1:parameter name="TransactionTrailerControlNumber" value="0001"/>
          <ns1:parameter name="InterchangeAuthorizationInfoQual" value="00"/>
          <ns1:parameter name="GroupSenderID" value="888888888888888"/>
          <ns1:parameter name="InterchangeAuthorizationInfo" value="          "/>
          <ns1:parameter name="GroupTrailerControlNumber" value="1"/>
          <ns1:parameter name="InterchangeTrailerControlNumber" value="000000001"/>
          <ns1:parameter name="TPName" value="888888888888888"/>
          <ns1:parameter name="SegmentDelimiter" value="~"/>
          <ns1:parameter name="InterchangeControlStandard_RepeatingSeparator" value="^"/>
          <ns1:parameter name="TransactionID" value="834"/>
          <ns1:parameter name="GroupControlNumber" value="1"/>
          <ns1:parameter name="InterchangeComponentElementSep" value="\"/>
          <ns1:parameter name="AckChildInvalid" value="None"/>
          <ns1:parameter name="InterchangeSecurityInfo" value="          "/>
          <ns1:parameter name="DecimalSeparator" value=""/>
          <ns1:parameter name="GroupAgencyCode" value="X"/>
          <ns1:parameter name="InterchangeSecurityInfoQual" value="00"/>
          <ns1:parameter name="InterchangeReceiverID" value="XXXXXXXXXXXX     "/>
          <ns1:parameter name="ReleaseCharacter" value=""/>
          <ns1:parameter name="TransactionControlNumber" value="0001"/>
          <ns1:parameter name="GroupTime" value="112755"/>
          <ns1:parameter name="InterchangeAckRequested" value="0"/>
          <ns1:parameter name="GroupDate" value="20130718"/>
          <ns1:parameter name="ElementDelimiter" value="*"/>
          <ns1:parameter name="b2b.messageId" value="0A523743140086685E200000497F6962-1"/>
          <ns1:parameter name="b2b.documentTypeName" value="834"/>
          <ns1:parameter name="b2b.documentProtocolVersion" value="5010X220A1"/>
          <ns1:parameter name="b2b.documentDefinitionName" value="834_def"/>
          <ns1:parameter name="b2b.documentProtocolName" value="EDI_X12"/>
          <ns1:parameter name="b2b.messageType" value="1"/>
          <ns1:parameter name="b2b.fromTradingPartnerId" value="888888888888888"/>
          <ns1:parameter name="b2b.fromTradingPartnerIdType" value="Name"/>
          <ns1:parameter name="b2b.toTradingPartnerId" value="XXXXXXXXXXXX"/>
          <ns1:parameter name="b2b.toTradingPartnerIdType" value="Name"/>
       </ns1:errorDetails>
    </ns1:Exception>

    Hi -
    From the error "The external code list ", it looks like ECL is not installed or not available with ecs.
    1. Have you installed ExternalCodeList when you installed your Document Editor?
    2. If not, install it, recreate ecs, xsd files. And rerun the transactions. That should fix your issue.
    Thanks,
    Kathar

  • How to passing value into Captivate from html?

    How to passing value into Captivate from html?
    Or
    How to communicate between objects in one slides?

    Hi czhao0378 and welcome to the forums!
    Captivate does not natively allow you to communicate your own
    data, either internally or externally. The only way to make this
    happen is to create your own functionality, either via custom-built
    Flash objects or JavaScript code executed in the browser or a
    combination of both.
    The only example I've seen of any "data passing" inside
    Captivate is a custom text input/output solution that was posted on
    the Captivate Developer Exchange:
    http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1253 021
    This solution consists of an input box that takes information
    from the user on one slide and a second box that displays that
    information on another slide. The functionality was built in Flash
    and is embedded in Captivate as a Flash "animation". Unfortunately,
    since this is a custom functionality, the information is not
    included in the user completion results Captivate can pass to a
    Learning Management System.
    Since the solution mentioned above relies on a Flash
    Actionscript variable to hold the information that is displayed,
    you can also pass the information from HTML to Captivate using the
    "SetVariable" command in JavaScript. This would at least allow you
    to display your own HTML-based data inside Captivate.
    Beyond that, I'm not aware of any other way to gather and
    pass data in Captivate.

  • Err:Two-pass & Expence reporting properties from dimension build rules file

    Hi All,
    i'm trying to build account dimension from rules file along with properties.
    My source file for dimension building is like below:
    Parent,Member Name,Alias,Consolidation,Storage,Time Balance,TB Skip,Variance Reporting,Two Pass,Formula,UDA1:Account
    Account,Acc1,,+,Dynamic Calc,None,None,Non-Expense,Two-Pass Calc,,Revenue
    Acc1,Acc2,,+,Dynamic Calc,None,None,Non-Expense,Not Two-Pass,,Revenue
    Acc1,Acc3,,+,Dynamic Calc,None,None,Non-Expense,Not Two-Pass,,Revenue
    after building dimension 'non two-pass' values are showing as 'two-pass' and 'non-expense' are showing as 'Expense'.
    if any one knows please let me know.
    Thanks in advance.
    Kiran

    Try using member property codes :- http://download.oracle.com/docs/cd/E12825_01/epm.111/esb_dbag/frameset.htm?dotrules.htm#dotrules_2
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Repeatly passing data to and from external program

    I'm looking for some help to get me started.  I'm willing to bet
    the info is here I'm just not sure what to look for and my searches
    aren't reveiling anwsers. 
    Background: I'm trying to take control of a device that is comunicating
    through the PCI bus.  The device has a set of API dll's that I can
    access through C++, but not directly in LabVIEW.  So wish to creat
    a wrapper program that will give LabVIEW indirect access to the
    dlls.  
    Problem: I've breifly read up on CINs and Libaray call functions and
    have found one underlying problem with both.  I have not found a
    way to pass data back and forth between the external code and LabVIEW
    once the external code is running.  I require an interactive
    conection between the two. 
    Any sugestions of what to search for would be greatly appreatiated, or even how to resolve my problem.
    Thank you.
    Don't get even, get odd!

    If the data buffers are owned by the driver and are updated asynchronously, you should expose that buffer to LabVIEW as a handle (simple int32 for the pointer to the buffer). This can then be passed to the wrapper code and checked (implements your polling). Remember that handling tasks in LV that should run in parallel is different from C++ however - you don't create threads, instead you should simply set up independent loops.
    I'm not sure what else to suggest since I don't fully understand what the API does or what the HW is doing, so feel free to post more information if you want more suggestions
    Brian Tyler
    http://detritus.blogs.com/lycangeek

  • Passing values to Jframe from JApplet

    Hi All,
    i need to open a frame when someone clicks on some particular part of an applet. also, i need to pass some values to that frame based on the region selected.
    Previusly i m doing it through showDocument method which calls a JSP which in turn calls the applet that i m trying to change as a frame now.
    Help please.
    Liza

    just to make things more clearer... i was passing values as querystring to JSP which passes them to an applet through parameter tags.
    Liza

  • Passing values to OnDemandProcess from Select Statement on Reports Page

    I think I'm just missing some of the proper syntax, Can somebody please help me.
    As I've come to understand this process of passing the values,
    I recognize it as (3) steps.
    1. Referencing the "javascript" in the Select Statement of the Reports Page.
    2. Including the "javascript" in the Page Header region.
    3. Defining the Process as an OnDemand Application Process.
    My problem is:
    a. I can't seem to get the Value passed to the Application Process.
    b. I don't know how to reference the Value passed once I get it passed.
    Here's what I've got done so far:
    1. (The Select Statement)
       onClick="javascript:ORDER_CONNECT_SEQUENCE('||ID||')
    {code}
    2. (The javascript)
    {code}
    function ORDER_CONNECT_SEQUENCE('+ID+')
    var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=ORDER_CONNECT_SEQUENCE',0);
    get.add('+ID+');
    gReturn = get.get('+ID+');
    {code}
    3. (The Application Process)
    {code}
       BEGIN
       Select '+ID+' into THIS_CIRCUIT from dual;
    {code}
    I Know that the Application Process is being referenced and that the OnClick routine is working properly,
    because if I plug a Value into the Application Process, instead of using '+ID+',
    Then I get all of my desired results.
    Any help you can give me here is greatly appreciated.
    Thanks- Gary                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Dimitri, Thanks for your efforts here, but its still not working for me.
    Here's what I understand from your suggestions:
    1. (changes to the javascipt)
       a. replace function ORDER_CONNECT_SEQUENCE('+ID+')
           with
           function ORDER_CONNECT_SEQUENCE(pId)
       b. replace get.add('+ID+')
           with
           get.addParam('x01',pId)
       c. replace getReturn = get.get('+ID+')
          with
          getReturn = get.get()
          get = null2. (chages to the Application Process)
       a. add l_value varchar2(4000) to my list of declarations
       b. add l_value := wwv_flow.g_x01 below the begin statement
       c. I guess then I would reference the l_value like this:
           Select l_value into THIS_CIRCUIT from dual* Also, You didn't mention any changes in my Select statement in the Reports region of the page.
    FYI.
      onClick="javascript:ORDER_CONNECT_SEQUENCE('||ID||')
    {code}
      The 'ID' which I'm referencing here is an ID from the table which I'm querying.
    Am I misunderstanding you somewhere?
    Thanks- gary                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Passing values to jsp from html..

    Hi all,
    I have a jsp containing a selection list and need to pass the value to the java segment of the jsp. When reserching this, I've found some info where an html page was created, an initial jsp was saving the info (or bean was used) and then a third jsp displayed the data (using buttons). This is too many steps and I'm needing a way for the same jsp to display containing the selected option (simulating a refresh with the post when the drop down list is used). Is redirecting while setting and getting attributes all at once feasible/possible or is there a better direction or work around for this?
    Thanks in advance,
    Geoff-

    I would think submitting the page to itself, and setting hidden fields to signal that it is a resubmission, may be the way to go. If the new information being displayed is minimal, JavaScript may also work, by setting up an empty <div> or <span> and setting the innerHTML or innerText properties. The advantage of the JavaScript solution is it would be quicker, having the client do all the processing, but it also browser dependant.

  • Passing values to FM froma selection screen

    Hi Guys,
    I have a selection screen in which i have 'From' and 'To' input fields.Also using multiple select button i can select discrete values.In the function module they have a table type in the import param.
    Is it possible to send the  values within the range plus the discrete values selected? If yes, then please help.
    Thanks,
    tubai.

    Hi,
    You can below code:
      DATA: rt_ranges TYPE REF TO data.
      FIELD-SYMBOLS:  <fs_select> TYPE table,
                                <fs_wa>  TYPE ANY,
                                <fs_wa1> TYPE ANY.
      DATA: lt_select  TYPE TABLE OF rsdsselopt,
                wa_sel_opt TYPE rsdsselopt.
    Retrieve the data from the select option
      rt_ranges = wd_this->w_handler->get_range_table_of_sel_field(
                               i_id = 'SELECT' ).
    Assign it to a field symbol
      ASSIGN rt_ranges->* TO <fs_select>.
      IF NOT <fs_select> IS INITIAL.
        LOOP AT <fs_select> ASSIGNING <fs_wa>.
          ASSIGN COMPONENT 'SIGN' OF STRUCTURE <fs_wa> TO <fs_wa1>.
          lwa_sel_opt-sign = <fs_wa1>.
          ASSIGN COMPONENT 'OPTION' OF STRUCTURE <fs_wa> TO <fs_wa1>.
          lwa_sel_opt-option = <fs_wa1>.
          ASSIGN COMPONENT 'LOW' OF STRUCTURE <fs_wa> TO <fs_wa1>.
          lwa_sel_opt-low = <fs_wa1>.
          ASSIGN COMPONENT 'HIGH' OF STRUCTURE <fs_wa> TO <fs_wa1>.
          lwa_sel_opt-high = <fs_wa1>.
          APPEND lwa_sel_opt TO lt_select.
        ENDLOOP.
      ENDIF.
    You then pass lt_select to your FM.
    Regards,
    Priya

  • Passing values to FG from program

    Hi all
           Please help me to sort this problem.I have to call a screen in the Function group from a report  program so I am using below code to call it.
    clear bdcdata_wa.
      bdcdata_wa-program = 'SAPLZSECURITIES'.
      bdcdata_wa-dynpro = '0300'. "where 300 normal screen
      bdcdata_wa-dynbegin = 'X'.
      append bdcdata_wa to bdcdata_tab.
      call transaction 'ZDOCS_SECURITIES' using bdcdata_tab.
    Now I have to access the values from the program in FG screen after calling the screen.So I used below code but it is not working.Please help me to sort it out.
    assign ('(ZCML_DOCS_SECURITIES)I_VDARL') to <fs_vdarl>."I_VDARL Structure
          if sy-subrc = 0.
            move <fs_vdarl> to i_vdarl.
          endif.
    Thank You.
    Regards
    Giri

    That would work if it's an include/form, and you read data from the main program. But I do not know if it can be used with a call transaction. Maybe the problem is that it is not the same LUW... But I am not sure.
    I can't see anyting wrong with the code itself.
    When debugging, is the field symbol <fs_vdarl> assigned?
    Can you use an export to memory instead?

  • Passing values in table from one component to another component in gp

    hai all,
      I have a table with 5 rows in a view in component1.I need to pass the values in the table from component1 to table in component2.Plz help me with coding of interface controller of both component.
    Thanks in advance
    regards
    Sharanya.R

    Hi,
    Here more than coding its mapping of your components are important to transfer data
    Ex:
    You need to have a public part that exposes the node which is bound to the table in COMPA.
    Then in COMPB you need to make COMPA as used COMP.
    Then you need to map the contexts between them.
    Once this is done . You will need to code if you want to iterate through the elements.
    Following Docs will help you get  a  clear understanding
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f727d100-0801-0010-4cbd-b0ad5c161945
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e1f4df00-0801-0010-6298-8fdf667bbd0f
    Regards
    Ayyapparaj

  • Passing data to and from Comm Sub Vi with 2 loops

    Im sure this is simple, and I think Im stuck in vacation mode and cant wait the 4 more hours till I leave, but this is really bothering me. I have a pretty large Queued State Machine and within that machine I have some states which must communicate via the TCP/IP port. My servers are complete and made into Executables and work fine, however I want to leave my clients as sub vi's so that I can easily pass in and retreive data from them. They are designed with 2 while loops, one for sending the data and one for reading the data back. At the very least the read loop needs to remain in a loop to pick up unsolicited messages from my CAN server. However when I place these into my master QSM they hold up the process because of the loops executing. Now I have made a separate loop in my QSM for all my communication clients so the rest of the QSM runs but I cant pass data into these clients because they are stuck executing the loops internally and dont stop to pull in data.
    I should note that if I run my QSM to spawn the servers, then run my client as a separate VI rather than a sub and type my commands there then they execute perfectly.
    So if you can follow my crazy description what would be the best/cleanest way to circumvent this so I can get moving ahead. Thanks, Dave

    Dave,
    Would it work to use a queue to pass data from your main QSM loop to your communication loop? You could write the commands to the queue from your main QSM loop, and pick them up in the communication loop. They would then still run in parallel. Let me know if this works, or if you are looking for something else.
    Robert Mortensen
    Software Engineer
    National Instruments

  • Passing values as parameters from forms

    We are trying to use the On successful submission of a form area to forward to a report based on a value entered on the form.
    Is there a way to use a value from the form in the url?

    Here is the code I used. The code in bold allowed me to use the value entered on the form as a parameter for the report I am forwarding to.
    declare
    bidder_id number := 0;
    blk varchar2(10) := 'DEFAULT';
    begin
    bidder_id := p_session.get_value_as_number(p_block_name => blk,
    p_attribute_name => 'A_BIDDER_ID');
    go('PBR.SUM_REG_INFO.show?p_arg_names=pbr_bidder.bidder_id&p_arg_values='||bidder_id);
    end;

  • Best way to pass data to and from a fieldpoint unit

    Hello,
    I am just starting to play with a fieldpoint unit and I was wondering the best way to send and receive data with it.  We are setting up a pumping station and need to send the FP a setpoint and be able to read other sensor connected to it.  I know there are at least a few options such as data socket, publish data, shared variables and maybe tcp/ip.  But I was wondering as to the best/easiest option.
    Thanks

    For case #1, you wouldn't have to do anything special.  The setpoint would just remain at whatever value was last written to it by the host system (the one where you are at the controles).
    For something like #2, you would probably want an extra routine, such as read the timestamp of the shared variable, if the cFP sees that it is too old (whether that would be a minute, an hour, a day ....) then the code goes into a pump down routine.  Another possibility would be a watchdog type of shared variable.  The host system periodically increments a counter and sends it to a shared variable on the cFP.  If the cFP sees that the counter hasn't incremented in a given period of time, then it can assume a connection was lost and do the shutdown routine.
    Going with shared variables will definitely get you started quicker.  Good luck with your application.

Maybe you are looking for