This error message typically shows up if a set field step attempts to modify a field via a reference to a table occurrence that is not related to the current layout's table occurrence. None of the calculations in your script would produce such an error. If the context is not correct, such calculations would simply fail to return a value.
Once you have advanced, you can use the script debugger to more easily look for the culprit. But I suspect that commit records is tripping a script trigger and a different script is interrupting this one with a set field step that produces the error you are seeing here.
Thank you so much! What I tried to do was clear the Commit Records script step to see if that would help and unfortunately it didn't. My 3 tables for this particular layout are
- Person Injured (xP_EmpID = serial number)
- Injury Information (xH_EmpID = number field directly related to xP_EmpID)
- Treatment Information (xE_EmpID = number field directly related to xP_EmpID)
I have the layout set up with a slide control and each one has solely one specific table's fields on it. The layout is based on the Person Injured table occurrence.
Which does not change the fact that no part of your script shown attempts to modify data and thus there is no "target" reference that can be from an unrelated table occurrence. So I still think that some other script is the actual source of this error message.
Would the script debugger in Advanced show which other script is trying to run?
I figured it out, thank you SO much for all your help. I have a VERY similar field in an unrelated table that I created that calculation for and instead of changing it to the right field when I chose to use essentially the same code in a different table, I left it as the field from the unrelated one. I changed the field and it works perfectly now :)
Yes, the debugger will catch "triggered script interference". As you step through a script in the debugger, if it trips such a trigger, the trigger performed script will automatically pop up in the debugger.