Hide/Show section 'resests' calculations!?! - InfoPath Dev
in

InfoPath Dev

Hide/Show section 'resests' calculations!?!

Last post 04-22-2016 05:22 AM by dkjadasc. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 04-09-2016 12:43 AM

    Hide/Show section 'resests' calculations!?!

    I have a SharePoint list with 'MasterData' on the projects in our organization and I am using InfoPath 2013 to improve the user experience of the data input.
    The issue is that when I make a selection that makes the input form show or hide a section of the form, then calculated fields that have new data input in same update session are 'reset' to the value of when it was saved, when the form is saved and closed the calculation reflects the new input.

    E.G.

    Field_A = 100
    Field_B = 150
    Field_X = Field_A + Field_B = 250

    IF 'A' is changed to 200, then 'X' is updated correctly to 350, however if I somewhere else change a different field that via a rule trickers that a section is show/hidden, then field X is again 'reset' and shown as 250 ??
    While after saving the form, 'X' is again reflected as 350 This is obviously quite confusing for the user during input (and I do not want the form to save every time a field is changed)
    (I have tried to have the 'calculation' both as "data source" and "default value" but with same result)
    ---- 

    I am considering that all fields that tricker a section to show/hide could have a rule that force them to update the value of X, however before testing if works this I would like you take on this as it seems like a heavy workaround to an issue that possibly have a much simpler solution.

    N.B.
    I have several calculations like this, so in total I have around 8 X's that reset...
     

     Thanks for the support
    /Jan 

  • 04-18-2016 06:36 AM In reply to

    Re: Hide/Show section 'resests' calculations!?!

    Hi Jan,

    Have you tried  using a rule in the form? You say data source, but that suggests you are using something in the list settings. Default value always runs - you can disable recalc on it. That might be worth trying. Otherwise, just add a rule to Field A and Field B that updates Field X by setting it equal to A+B. It will only fire when one of those fields changes.

    Good luck! 

    Patrick Halstead
    Project Manager at Qdabra
  • 04-22-2016 05:22 AM In reply to

    Re: Hide/Show section 'resests' calculations!?!

    You are on to something, I however managed to solve it with a variance of this;
    Re-cald should be active, otherwise X is not upadted when A+B change (this part works fine). However when hide/show of a section somewhere for some reson resets the calculation of X it therby changes X (not A or B). 

     Therefore I made a rule on X that when this field is changed, it is updated to A+B! thus an update in A or B will still result in X = A+B, furthermore the 'reset' of X simply trickers and instant updatet of X, so it is agan = A+B.

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.