1 Reply Latest reply on Apr 22, 2015 11:18 AM by Jade

    Dynamic Maths?



      Dynamic Maths?


      Hi there

      A need has arisen to show/hide and include/exclude details and values in a form based layout.

      I have a data table in the format:

      Description | Total

      Desc1        | 1000

      Desc2        | 2000

      Desc3        | 3000

      In turn, this would be shown on my layout currently in a portal.  The total at the moment is 6000.

      What I need to be able to do on the same form is:

      1) Have the user select which rows to include or exclude

      2) Have FM hide the appropriate rows

      3) Have FM add up the values for the remaining rows.

      For example, if a user selected to hide row 2, the new total would be 4000.


      Any ideas at all on this??

      Thanks in advance

        • 1. Re: Dynamic Maths?


          Hi Stu412

          Here is one approach:

          Add two fields to your data table (child):  A Summary field based on the total of Total and a Checkbox field with the value list of  "Show"

          Add the Checkbox field to your portal on the parent layout.

          Add a second portal with 1 row under the first portal based on the data table (child) containing the Summary field only.  Filter this second portal with the formula: Data Table::Checkbox = "Show"

          When the user checks the checkbox on a row the Summary will include its Total.  When a row is unchecked the Summary is reduced by that amount.

          Note: This does not "hide" the unchecked row(s).  That way, the user can see what row(s) are excluded and recheck to include them if needed.  You can use Conditional Formatting to change the font colour for Description and Total of these rows to light grey or another colour—including white or transparent—if you like.

          Note 2: The Summary will update when the user commits the change by clicking or tabbing out of the portal.  Consider using a trigger to commit the change if you want.