You are viewing limited content. For full access, please sign in.

Question

Question

Calculation on table clearning value

asked on June 11, 2020

I have a field in a table that I want to fill in with a number if another value in the row is "Plan".  This work with:

If I put in Plan it puts the number in.  If its not plan, the user is just going to put in a number.

However, if they put in a number, and I hit add to the table, the calculation is running again and it clears the previous row number

Click Add row:

This is probably because the If statement is running again and since Fund Source is not plan it is putting in "".  But why is it running on the previous row as well?  If I hit add, I want to leave the previous column alone.  I have tried adding another hidden filed in the table and set it = to acct and instead of "" in the first formula but that row value but I get a circular calculation error.

0 0

Replies

replied on June 11, 2020

When a change is detected in the table that triggers the underlying code that handles calculations. I'd imagine it is configured that way because calculations could be based on fields from essentially anywhere on the form so they need to make sure they stay updated when anything changes.

The bottom line is that your calculation is always going to override user input, so you can't use a calculation to make a field "alternate" between fixed and user-selected values. To accomplish your goal you will probably need to use custom JavaScript that only changes the value when "Plan" is entered.

2 0
replied on June 11, 2020

Thanks Jason, I switched it to a lookup rule.  Made a table just for that attribute.  Appreciate the advice on JS.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.