I have a simple function where, if a parameter is met, set the document variable equal to a subarray
if document.dateofros=="" then
for count=1,count<=size(Array),count=count+1
do
SUB=getfield(Array[count],"^","")
if Sub[1]=="ROS" then
document.dateofros=SUB[2]
followed by the conditions of the function. I have this running in 2 forms within an update so it can be called from either form. When I run it from form A, I get
Array[2]
"11/03/2020"
DOCUMENT.DATEOFROS="11/03/2020"
ERROR: 32786 COULDN'T FIND THE SYMBOL
and the document variable stays empty. In form 2, it works just fine. Any thoughts on why it is saying the symbol could not be found????
The most probable cause is that the doc var is not being initialized before being called. If it is NOT a field that physically exists on the form, be certain to initialize it in the MEL code.
{! DOCUMENT.DATEOFROS}
I suspect it either exists on the other forms, has been initialized in the other forms, or it was initialized previously, perhaps by a different form.
MEL requires variables to be initialized (declared) prior to being assigned a value, especially doc temp variables. Sometimes you can bypass this (unexpectedly and unknowingly) via recursive executions, but that is not ideal or optimized and places undue stress on the system.
Thanks Lee, that was exactly the problem. It existed in a different form and on one of the forms, I had it set to "Make available to other forms" but not on the other. Thank you!