I saw your test and I realized that the script was applied only for the first record. Does that mean that we should create another script to update all records ? Do you have another tip or suggestion on how to handle the problem. As it is now the period sensitive for update, I don't give access, sorry for that. thank you
The issue with the "If statement" occurs if any number field that is specified within the if statement does not contain a value. Hence please configure default value as 0 for all the number fields from the Edit field option. This will solve the issue and the input.test_Unspent and input.Flag_of_Unspent_Funds will be
updated, based on the If statements.
Since the on add -> on success script is executed when a new record is added to the database, the value of input.test_Unspent and input.Flag_of_Unspent_Funds will be updated for the newly added record.
If you want the value to be updated for all the existing records, add a script to the on add -> on load block with the If statement within the "for each record" task as shown in the format below. The script will be executed when the form is loaded and all the records will be updated. After the update, you can delete this script from the on add -> on load block.
for each x in Activities [ID != 0]
if ((x.Q4_Vertical_Spent + x.Q4_One_UN_Spent + x.Q4_Core_Spent) != 0)