Updating Infopath Repeating table fields

Posted on 2011-05-05
Last Modified: 2012-05-11
In my form I have the following fields:
Vendor (a dropdown field that gets its values from a secondary data connection)
VendorCurrency (value based on secondary data connection relative to the Vendor)
ExchangeRate (initially set via a secondary data connection to a sharepoint list)

And in a repeating table in the same form I have the following fields:

The idea is that the user will enter the LineItemCost and LineItemCurrency and the FinalLineItemCost would be calculated via rules added in both the LineItemCost and LineItemCurrency to caculate based on the exchange rate. The rules are as follows:
 •      If SupplierCurrency = LineItemCurrency then FinalLineItemCost = LineItemCost
•      If SupplierCurrency = “CAD” and LineItemCurrency = “USD” then FinalLineItemCost = ExchangeRate * LineItemCost
•      If SupplierCurrency = “USD” and LineItemCurrency = “CAD” then FinalLineItemCost = (1/ExchangeRate) * LineItemCost

Now I want to allow the user to change the ExchangeRate, however I cannot figure out how to update the FinalLineItemCost for each row of the repeating field since those fields are calculated via a rule in the other two LineItem fields.
Question by:Alarius
    LVL 28

    Accepted Solution

    Yah, as it stands, unless the other fields are touched then it does not work.

    one idea is to add a exchange rate to your repeating table, it does not have to be shown in the view but used in the calculation.
    then when the master/global exchange rate is changed it can change the repeating ones which would trigger the recalc.

    hope that helps.

    Author Closing Comment

    That worked!
    I added 'LineItemExchangeRate' with default value = ExchangeRate. (recalculate checked)
    I had to copy the rules from LineItemCurrency into this field, so a change in ExchangeRate would change LineItemExchangeRate which would then in turn change FinalLineItemCost.

    A little dirty but as long is it works :)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Before you can digitally sign infopath forms, you must have a digital certificate. Microsoft Certificate Services will need to be enabled on a Windows Server 2008 to facilitate the creation and verification of the digital certifciates on the web ser…
    This post first appeared at Oracleinaction  ( Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video discusses moving either the default database or any database to a new volume.

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now