If your two scripts are in different files, you should pass the value of the global field in file 1, the file, I assume, which has script 1 and the global field, as a script parameter to script 2 in file 2.
Global fields can be referenced across all layouts/tables within a given file, but not across different files. The value would need to be passed in a Script Parameter as Rick describes or you'd need a relationship from File 2 to the table in File 1 (how we did this before script parameters) in order to access the global field. Since the field is global, any relationship that matches to at least one record in the table will make the global field accessible.
OK, I was able to pass the value of the global field and script runs fine in file 2. Now that I have the result (global field) which should go back to file one but with no luck. I even created another script to pass result back to file one but failing. I have tried relating one of the global field to file to still with no luck.
You do not use the global field in the relationship. You link by some other field in the same table.
GlobalsTableFromFile1::AnyNonblankfield X CurrentTableInFile2::AnynonblankField
An alternative is to use Perform Script to perform a script in file1 from File 2 and pass the value back to it via another script parameter. This script can then use Set Field [table::globalfield ; Get (ScripParameter)] to update the global field's value.
Thank you both! You learn every day...:) I finally got it and it works like a charm. Incase I need to pass multiple parameters, what would be the syntax for it?
One last question, I discovered that one of my value list displays "Part Numbera and a Calc Field" It works just fine but, discovered several Part numbers shows up in value list but when I look at my inventory records, I can find them? Is there a under the cover list refresher? This scares me a bit and I want to make sure what you see on list is what you have in your inventory.
There are several ways to pass multiple parameters. They all combine the values into a single parameter but use different methods to separate them back out on the other end.
My favorite is to use the list function.
In the parameter box, enter an expression like this: List ( param1 ; Param2 ; Param3 )
Then, at the beginning of my script, I put this code:
Set variable [$Param1 ; GetValue ( Get ( ScriptParameter ) ; 1 )
Set variable [$Param2 ; GetValue ( Get ( ScriptParameter ) ; 2 )
Set variable [$Param3 ; GetValue ( Get ( ScriptParameter ) ; 3 )
The only catch is that Param 1 and Param 2 cannot be empty or the parameters misalign in the list.