Sum Fields Values Identified by Another Field

Working in LiveCycle ES2. Very basic experience in developing scripting. Have created an expandable Expense Reimbursement form with a replicating table for each expense item (e.g., row). Have a subform at the end of the form to capture the totals.  Have been able to script to capture the AmountSpent for all of the expense items:
form1.MainForm.TotalsSF.Table4.Row2.EmployeeExpenses::calculate - (FormCalc, client)
Sum(ExpenseDetailsTable[*].ExpenseTypeRow.AmountSpent)
Need to script to capture the AmountSpent for only items that are identified as NonReimbursable:
form1.MainForm.TotalsSF.Table4.Row3.NonReimbExpenses
Have a checkbox in the table to identify an expense item as NonReimb.  This box replicates with the table.
form1.MainForm.ExpenseDetailsTable.DetailsLocationRow.NonReimb
How do I script a calculation to sum all of the AmountSpent for each item that is checked as NonReimb?

You should post this in the forum for LiveCycle Designer. This forum is for documents created in Acrobat.

Similar Messages

  • Making a DFF field mandatory based on another field

    Hello All,
    We have a requirement where in we need to make a DFF field mandatory based on another field.
    example:
    DFF has two fields :
    Filed1 : values 'Email', 'Fax'
    Filed2
    If 'Email' is selected in 'Field1' then Field2 should become mandatory.
    Any inputs on this will be really helpful.
    Thanks & Regards,
    Satya.

    hi kumar3a,
    recently, i spent considerable amount of time wracking my brain on a similar problem. the nearest i came to a solution was when i used a forms personalisation. mind you, forms personalisation will not work directly on the DFF window, so it has to be approached in a roundabout sort of way.
    i got this information from an Oracle Support personnel - MOS Note 1078348.1.
    i would start with the flexfield segment as "not required", and then using Forms Personalization, i would make it "required". i would try to figure out how to establish a condition where the previous 'required' flexfield segment's value is checked to see if this 'not required' segment needs to be made 'required'. in theory, this should solve the issue. i gave up on it because the forms personalisation would need to cover WHEN-VALIDATE trigger event, and we had close to 100 validations going on through other preexisting forms personalisations, which rendered it near impossible to employ this method.
    best regards.

  • Set the default field value to transaction code field, when calling from WD

    Hi all,
    Can we pass the value in a input field of a standard transaction calling from WD application. Suppose we are calling a transaction VA03 in an external window, then how will be pass the value in the VBAK_VBELN screen field.
    Is there any way to pass the value to this transaction field. I have also tried out to set the parameter ID 'AUN' for VA03 transaction VBELN field. But it did not work for me.
    Is there any way to set the default field value to transaction code field, when calling from WD?
    Please suggest, if anyone have any idea.
    Thanks
    Sanket

    Hi,
    I am using the below code to open a standard transaction. It will help you to explain my point more easily.
    DATA: url TYPE string,
              host TYPE string,
              port TYPE string.
    *Call below method to get host and port
      cl_http_server=>if_http_server~get_location(
         IMPORTING host = host
                port = port ).
    *create URL
      CONCATENATE 'http'
      '://' host ':' port
      '/sap/bc/gui/sap/its/webgui/?sap-client=&~transaction=' 'VA03'
       INTO url.
    *get the window manager as we are opening t code in external window.
      DATA lo_window_manager TYPE REF TO if_wd_window_manager.
      DATA lo_api_component TYPE REF TO if_wd_component.
      DATA lo_window TYPE REF TO if_wd_window.
      lo_api_component = wd_comp_controller->wd_get_api( ).
      lo_window_manager = lo_api_component->get_window_manager( ).
    call the url which we created above
      lo_window_manager->create_external_window(
      EXPORTING
      url = url
      RECEIVING
      window = lo_window ).
      lo_window->open( ).
    Note*
    One more query I want to add to this thread, that is there any possibility to call a custom transaction as well?

  • How to have a field automatically fill in another field when checked

    Does anyone know if there is a way to have a field automatically fill in another field with a specific dollar amount when a field is checked.
    I am doing a registration sheet for a charity event where we have to pay for each person that attends. I would like it set up so that when someone checks in the person at the registration table would just click the check box (E2) and then have it fill in the field next to it a dollar amount of $15.00 (F2) which would be owed to the place hosting the event.
    Attached is a picture of the spreadsheet: example: persons checks off E2 and the amount $15.00 would automatically fill in field F2. I would then do this for each line and have the F column total the amount owed to the place.
    I am VERY new to numbers and writing formulas so if you can be specfic with how to do the code would be greatly appreciated. THANK YOU!

    please remember to post the actual solution (equation in this case) so others that are searching for similar items see the solution, not just
    Got it, replaced 0 with '''.
    Thanks
    Jason

  • Sum the values of a text field in a tabular form using JavaScript

    Hi Folks.
    OK, I put my hands up. I don't know Java script but I'm picking up the basics and I WANT to learn.
    Here's my situation.
    I have a tabular form which has lots of Standard Report Columns and ONE text field.
    I want to sum the values entered in the text field, real time, using Java Script without the need to have a round trip to the database.
    I'm guessing this will involve some kind of loop. Once I have that SUM figure I will store it in a hidden item and it will be used for validation when the user submits the form.
    If anyone can give me a simple Java Script to do this, or point me in the direction of one, I'd be very grateful.
    Many thanks.
    Dogfighter.

    Hi Arie.
    Thanks for the link.
    That's a great start,
    What I've got working so far is the following...
    <script type="text/javascript">
    function f_calculate_delta(p_this,p_rownum)
    var amt = $x(p_this).value;
    alert (amt);
    var display_item_to_set = 'f08_'+ p_rownum
    $x(display_item_to_set).innerHTML = amt
    </script>
    This is working fine.
    Where I'm stuck at the moment is how I can 'get' the value of another cell in the same row. They have all been set up using the APEX_ITEM API with their own unique IDs.
    I will continue looking but if you could give me a steer, that would be great.
    Many thanks
    Simon
    PS. APEX 3.1
    PPS. Trying to get the value of another row using...
    var display_item_to_get = 'f04_'+ p_rownum
    var expected_amt = $x(display_item_to_get).value
    PPPS. Also tried...
    var display_item_to_get = 'f04_'+ p_rownum
    var expected_amt = $v(display_item_to_get)
    and
    var display_item_to_get = 'f04_'+ p_rownum
    var expected_amt = $v(display_item_to_get).value
    None of which are working at the moment.
    Message was edited by:
    Dogfighter

  • How do you output a field column depending on another fields value?

    when selecting a field in a query, how do you output it on its own column depending on another fields value?
    For example
    Select
    a.gross_vol as Gas_vol when a.Object_code = "GAS"
    a.gross_vol as Wat_Vol when a.object_code = "water"

    how do you output it on its own column depending on another fields value?Scalar subquery maybe?:
    michaels>  select (select ename from emp where empno = 7788) scott_ename,
           (select ename from emp where empno = 7839) king_ename
      from dual
    SCOTT_ENAM KING_ENAME
    SCOTT      KING 

  • Forms - Getting sum of values in the lines field

    Hi
    I have a form which is not based on any table/view
    The user has some line level details and some header level details. on save/submit button it should be saved in different tables/columns
    Line level details:
    It has say two fields. Item and item count.
    There can me multiple lines so each new item is entered in a different line and corresponding item count in the respective field.
    Header level
    We have a Total item count field which has to count the total of all the line item count.
    How can this be handled as this is not based on table and this value has to change each time the user enters new line.
    I have made a global variable( as the total count) and on when validate trigger of the line level item count, I add that value to the global variable.
    But there are some issues like if the user goes back and decreases or increases the value. then i have to put some further logic so that it does not give issues.
    Any other way to achieve this?

    simply put the summary column in Detail block which totals ur Items in detail Oracle will handle automatically
    Use the same field to transfer to Another table
    Baig,
    [My Oracle Blog|http://baigsorcl.blogspot.com/]

  • Can you mask a field value based on another?

    In XML publisher, is it possible to not display field values based on a value from another field?  If so, how can this be accomplished?
    For example, I have a field value for Address Line 1 as "123 Main Street".  I don't want the City, State, Zip, County and Country to be be displayed in the pdf output.  However, all other Address Line 1 values should be displayed.
    Thanks in advance,
    -joe

    PLD is a very basic tool.  The goal you try to achieve may not be available as I know of.
    Thanks,
    Gordon

  • Help to set value of an attribute based on value selected in another field

    Hi all,
    I want to set the value of an attribute STRUCT.ITM_TYPE to a default value whenever i select one of the value from dropdown list in LC_STATUS.
    I tried to add an event in the get_p method of the lc_status but there i cant able to access the context of the ITM_TYPE as the fields are in different views.
    Please Help,
    Rewards will be awarded.
    Naveenn

    Hi Vineet,
    Thanks for the suggestion.
    Please chech my code and suggest me for any corrections.
    In the Get_P_LCSTATUS method of Context Node BTADMINH in View1.
    METHOD GET_P_LCSTATUS.
      CASE iv_property.
        WHEN if_bsp_wd_model_setter_getter=>fp_fieldtype.
          rv_value = cl_bsp_dlc_view_descriptor=>field_type_picklist.
        WHEN if_bsp_wd_model_setter_getter=>fp_server_event.
          rv_value = 'ACT_STATUS_SELECTED'.
      ENDCASE.
    ENDMETHOD.
    In event handler method in Context Node BTADMINI in View2
    method EH_ONACT_STATUS_SELECTED.
    * Added by wizard: Handler for event 'ACT_STATUS_SELECTED'
    data: lr_ent1 type ref to cl_crm_bol_entity,
             lr_ent2 type ref to cl_crm_bol_entity.
    lr_ent1 = me->typed_context->BTADMINH->collection_wrapper->get_current( ).
    check lr_ent1 is bound.
    * To Get Value of First Attribute
    lv_attr1 = lr_ent1->get_property_as_string( 'LC_STATUS' ).
    * To Set Value of 2nd Input Field now based upon this value
    lr_ent2 = me->typed_context->BTADMINI->collection_wrapper->get_current( ).
    *lr_ent2->lock( ).
    lr_ent2->set_property_as_string( iv_attr_name = 'ITM.TYPE'  iv_value = 'RREQ' ).
    endif.
    endmethod.
    but during syntax check its showing error messge as BTADMINH is unknown.
    2) How and where to bind the context node in custom controller.
    Please help.

  • Creating F4 with  values determined by another field

    Hi,
    I have a table with a few fields.
    I created a search help for the first field.
    According to my demands, the values of the search help of the second field should be determined according to the
    user selection of the first field.
    I thought to use SET/GET - so this way I save the value of the first field and I implement an exit method where I do the GET.
    But - where can I do the SET ??
    Thanks you all.
    Promise to award points...
    Ruthie.

    Find the following code.
    *---  IT for changing fields on the screen
    DATA : t_dynp_flds LIKE  dynpread OCCURS 0 WITH HEADER LINE.
    *---  Append values
      t_dynpfields-fieldname = 'ZPPA_IDR_ACTIONS-MASSN'.
      APPEND t_dynpfields.
      CLEAR  t_dynpfields.
    *---  Read screen field values before PAI field transport
      CALL FUNCTION 'DYNP_VALUES_READ'
           EXPORTING
                dyname               = 'ZPPA_IDR_MAINTAIN'
                dynumb               = '3004'
           TABLES
                dynpfields           = t_dynpfields
           EXCEPTIONS
                invalid_abapworkarea = 1
                invalid_dynprofield  = 2
                invalid_dynproname   = 3
                invalid_dynpronummer = 4
                invalid_request      = 5
                no_fielddescription  = 6
                invalid_parameter    = 7
                undefind_error       = 8
                double_conversion    = 9
                stepl_not_found      = 10
                OTHERS               = 11.
      IF sy-subrc EQ 0.
      READ TABLE t_dynpfields WITH KEY fieldname = 'ZPPA_IDR_ACTIONS-MASSN'.
        IF sy-subrc EQ 0.
          MOVE t_dynpfields-fieldvalue TO l_massn.
        ENDIF.
      ELSE.
        EXIT.
      ENDIF.
    *---  Retrieve values for reason for action
      lt_t530t-gap = space.
      SELECT t530~massg
             t530t~mgtxt
         INTO (lt_t530t-massg, lt_t530t-mgtxt)
        FROM t530  JOIN t530t
        ON t530tmassg = t530massg
        WHERE t530t~sprsl = sy-langu
          AND t530t~massn = l_massn
          AND t530~massn = l_massn.
        APPEND lt_t530t.
        CLEAR  lt_t530t.
      ENDSELECT.
      IF sy-subrc NE 0.
        CLEAR : lt_t530t,
                lt_t530t[].
    *---  No table entries found
        MESSAGE s001 WITH text-047.
        EXIT.
      ENDIF.
      SORT lt_t530t BY massg mgtxt.
      DELETE ADJACENT DUPLICATES FROM lt_t530t COMPARING massg
    mgtxt.
      CLEAR : l_tabix.
    *---  FM to give List of values of Org values
      CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
           EXPORTING
                endpos_col   = 85
                endpos_row   = 20
                startpos_col = 50
                startpos_row = 10
                titletext    = text-042
           IMPORTING
                choise       = l_tabix
           TABLES
                valuetab     = lt_t530t
           EXCEPTIONS
                break_off    = 1
                OTHERS       = 2.
      IF sy-subrc EQ 0.
        READ TABLE lt_t530t INDEX l_tabix.
        IF sy-subrc EQ 0.
    *---  Clear IT t_dynp_flds
          CLEAR : t_dynp_flds,
                  t_dynp_flds[].
    *---  Append screen values
          t_dynp_flds-fieldname = 'ZPPA_IDR_ACTIONS-MASSG'.
          t_dynp_flds-fieldvalue = lt_t530t-massg.
          APPEND t_dynp_flds.
          CLEAR  t_dynp_flds.
          t_dynp_flds-fieldname = 'ZPPA_IDR_ACTIONS-MGTXT'.
          t_dynp_flds-fieldvalue = lt_t530t-mgtxt.
          APPEND t_dynp_flds.
          CLEAR  t_dynp_flds.
    *---  Change screen field contents w/o PBO
          CALL FUNCTION 'DYNP_VALUES_UPDATE'
               EXPORTING
                    dyname               = 'ZPPA_IDR_MAINTAIN'
                    dynumb               = '3004'
               TABLES
                    dynpfields           = t_dynp_flds
               EXCEPTIONS
                    invalid_abapworkarea = 1
                    invalid_dynprofield  = 2
                    invalid_dynproname   = 3
                    invalid_dynpronummer = 4
                    invalid_request      = 5
                    no_fielddescription  = 6
                    undefind_error       = 7
                    OTHERS               = 8.
          IF sy-subrc NE 0.
            CLEAR : t_dynp_flds,
                    t_dynp_flds[],
                    zppa_idr_actions-mgtxt.
          ENDIF.
        ENDIF.
      ENDIF.
    -Anu.

  • How to fill a field with after changing another field in a multi form?

    Hi,
    I have multi occurence form in which multiple record are showeds and/or added.
    One field is a dropdown field, after filling this field (selecting a value in the dropdown), another field needs to filled with the selected value.
    My problem is that only the first occurence is filled with the value of the selected dropdown, even when filling the dropdown field in one of the other occurences.
    I tried point to the other occurences but this was not succesfull
    See script
    So when a sparepart is selected from the dropdown sparepart, the field defectpart must be filled the selected sparepart, when I have multi forms (occurences) only the first occurence defect part gets filled with the selected parts, even when a sparepart from another occurence is selected.
    data.p1.spare_parts.spare_parts::change: - (JavaScript, client) -
    p1.spare_parts.DefectPart.rawValue =  xfa.event.newText;
    Can anyone help to solve this problem
    Thanks
    Christophe Van Mechelen

    hi,
    Your code is right, i dont know why its not working,
    try this,
    dropdown field in change event,
    var c = xfa.host.newtext
    textfield1.rawValue = c;
    (or)
    textfield1.rawValue = xfa.event.newText;
    by
    Parthi

  • Retain all form field values after input text field validation failure

    Hi,
    I have a form with 1 input text field, one Command button and one h:selectManyListbox. when User enteres some values in input field and clicks on command button named Add, the value is validated. If input is invalid, then an error message appears next to the field. If input is valid, then the value is added into h:selectManyListbox. Adding to list box is done using Ajax4Jsf.
    Probelm:
    Let's assume user entered 3 valid values one after another and all are added into the list box. When he enters a wrong value, and error message appears. however, the entered values in list box goes away. Is there a way to retain the values even after validation failure.
    Code is given below;
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
    <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
    <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
    <h:panelGroup>
         <h:outputLabel for="inputEmailId1" value="Email Id: " />
         <t:inputText value="#{bean.newEmailId}" id="inputEmailId1" maxlength="100" size="40" immediate="true">
              <t:validateEmail message="Enter a valid Email Id." />
         </t:inputText>
         <t:message for="inputEmailId1" styleClass="errorStyleClass" />
    </h:panelGroup>
    <t:panelGroup style="text-align: left;" >
         <a4j:commandButton value="Add" styleClass="buttonsSub" action="#{bean.addSharedEmails}"
              reRender="inputEmailId1, selectedSharedEmails" />
    </t:panelGroup>
    <t:panelGroup style="text-align: left;">
         <h:selectManyListbox id="selectedSharedEmails" size="8" style="width:100%;" immediate="true">
              <f:selectItems value="#{bean.sharedEmails}" />
         </h:selectManyListbox>
    </t:panelGroup>
    Thanks in advance,

    Use the attribute "binding" instead of a "value". This will remember the value. You can also make sure that you dont have anything in your constructor or class level that initialises that value to "" or null. Because if JSF is remembering your value but your initialization that gets triggered before the page loading resets it to default values then you need to change that part of the code.

  • Adding field values together using Advanced Field Management

    Hi All
    I have 5 currency fields on the Revenue page, that I need to add together into one field, Total Amount (currency field also). I have made Total Amount field read only, and using adv field mgt set the following default and ticked post default:
    [<Revenue>]=[<cCorporate_Income_ITAG>]+[<cDonation_Income_ITAG>]+[<cFlower_Income_ITAG>]+[<cHost_ITAG>]+[<cMerchandise_Income_ITAG>]
    It does not seem to work, is this possible at all or am I not doing something right.
    Help....

    I'm having a very similar issue. I'm trying to do the calculation as a default field value and receive the following error:
    [1] An error occurred calculating the default value for field 'ZCur_5' in business component 'Revenue'.(SBL-DAT-00412) [2] Could not evaluate expression 'Expr: '=[<cMetal_Rate_ITAG>]*[<nQuoted_Weight_ITAG>]*[<nDross_Factor_ITAG>]'' for field 'ZCur_5' in business component 'Revenue'.(SBL-DAT-00394) [3] Generic SSA NOTOK error message.(SBL-DAT-00472)
    I can make the update work via workflow, but this does not help during the initial creation of the record.
    Any ideas?

  • Copy value from one field in subform, to another field in a different subform

    Hi all.  I have been back and forth with enterprise support, and they are telling me what I want to do is impossible.  I find that hard to agree with, so hoping I can get some help here.  I have a document that I am creating, based off an XML.  The page consists of a header subform, a flowing table of variable name, and then a footer.  My problem comes in, that when the table flows to mutliple pages, my header subform will not repeat, even though I have it set as the overflow header.  According to Enterprise Support, this is by design.  The header will repeat on the footer page, if that is on a separate page, just not when the table flows to another page.  So, I came up with a solution to create an additional Header in my table, merge all the cells into one column, and copy my subform into that new header.  I would set that header to appear only on subsequent pages.  So, when I preview my document, it shows the static text fine, as I would expect, however the text fields are blank.  I need a way of copying the values from the original header subform, into the newly created table header subform.  The values will be different based on teh XML input, meaning that the first 3 pages will have one set of values, and the next 3 another, etc..  See sample below...
    <NameValueList>
         <NameValue>
              <NameValueName>Name1<NameValueName>
              <NameValueDesc>Desc1<NameValueDesc>
               <TableValueList>
                   <TableValue>
                        Blah
                   </TableValue>
                   <TableValue>
                        Blah 2
                   </TableValue>
              </TableValueList>
         </NameValue>
         <NameValue>
              <NameValueName>Name2</NameValueName>
              <NameValueDesc>Desc2<NameValueDesc>
              <TableValueList>
                   <TableValue>
                        Blah 5
                   </TableValue>
                   <TableValue>
                        Blah 6
                   </TableValue>
              </TableValueList>
         </NameValue>
    </NameValueList>
    So, if I bind my original header to NameValueName, it will show on the first page which has my header, and the third page that has my footer.  But my 2nd page, that has the table flowed to it, has a blank value.  I tried to put code in the Initialize event of both text boxes, to copy from MainHeader.NameValueName to TableHeader.NameValueName, but that didn't work properly. 
    Any ideas on how to do this?

    Thank you very much for the reply.  I tried putting the copy statement in both the MainHeader and TableHeader initialize events.  There was different behavior, depending on the place I put the copy statement, however neither was correct.  If I put it in the initialize of the TableHeader, the NameValueName that appears on other page is Name1.  Even though the header shows Name2 when it hits the next nodes.  If I put it in the initialize of MainHeader, nothing is copied on the proper table header pages.
    I initially had Master pages, however that really didn't work.  The master pages traversed the NameValueName nodes on it's own loop.  So, Each page displayed the next value in it's own loop, when the main subform loop is still showing data from the previous value.  I know this might be hard to understand, but I'm doing my best to explain.  THanks again for your reply, and I hope that there is another idea out there to fix this...

  • How to set field checkbox values based on another field

    I'm trying to provide the user with the ability to check one box "Check All" which would then set the check boxes for a section to the same value as shown in the example.  Anyone know how I can accomplish this?
    Thank you.
    Example
    General Category A     [  ] Check All
         [  ]  Item 1
         [  ]  Item 2
         [  ]  Item 3
         [  ]  Item 4
    If user selects "Check All", all the Items in the list for "General Category A" are then checked automatically.

    You can create a document level function to check a series of check fiels as long as they all have the same checked value.
    // document level function that can be used for many sections
    function CheckAll(aFields, sChecked) {
    // test to see Check All box for being checked
    // and if checked set to aFields to checked value
    // otherwise clear fields
    if(this.getField(event.target.name).value == 'Off') {
    // field unchecked
    this.resetForm(aFields); // clear the fields
    // end box not checked
    } else {
    // check all box has been checked
    // loop through the fields to check
    for (i = 0; i < aFields.length; i++) {
    // all fields are assumed to have a value of 'Yes' when selected
    var f = this.getField(aFields[i]); // get field for element i
    f.value = sChecked; // set to checked value
    } // end loop to check
    // end checked
    } // end unchecked
    } // end CheckAll function
    // end document level function
    You can then add a mouse up aciton for the check all check box:
    // mouse up action for check all check box
    // define array of check box fields to process
    var aSecFields = new Array('Item 1', 'Item 2', 'Item 3', 'Item 4');
    // call CheckAll function
    // passing the array list of field names and checked value
    CheckAll(aSecFields, 'Yes');
    or you can use 1 line of executable code:
    // mouse up action for check all check box
    // call CheckAll function
    // passing the array list of field names and checked value
    CheckAll(['Item 1', 'Item 2', 'Item 3', 'Item 4'], 'Yes');

Maybe you are looking for

  • Outlook 2010 - 64 bit, Windows 7 64 bit, doesn't work ?

    I am using Photoshop Element 8 with Windows 7 English Versuin 64 bit, I installed in the past Office 2007 32 bit and Office 2010 32 bit, with office 2007 32 bit every thing works well, I am talking about sending email through Outlook, I don't remembr

  • I have a 10.5 how do i get lion?

    i want to upgrade to a lion. what do i need to do

  • Date store in database

    hi, i try to store date in database but not work, i use sun java studio creator 2 up 1 my bean file functiom is public String button1_action() { // TODO: Process the button click action. Return value is a navigation // case name where null will retur

  • Managing videos in Aperture

    I've been importing videos from my PAS's and iPhone into Aperture. I'm looking for some feedback as to the benefits of allowing Aperture to manage those videos. It seems as though when I try to upload a video from Aperture to my MobileMe Gallery, the

  • 11g R2: not able to deploy any objects

    Hi, I've got a huge problem: Since today I am no longer able to deploy any objects to our integration server. Normally we deploy our objects from our design repository to our integration-db with help of an expert. First I thought it would be an error