I created a custom layout.
Ill switch it.
I changed the layout to classic, just to experiment with it.
That did not work to set the global field.
I can only think of 2 things...
Are there residual items creating the issue?
Does it have to be made from scratch to get it to work?
And a third question...
If i use set field function, how will that effect several users?
Ah, so this is a global field, not a global variable (you originally used global field in the title, but then global variable twice in the description).
Is the global field in the layout's base table or a related table in the same database or a related table in a separate file?
Global fields are unique to each user, so using a Set Field on a global field will not affect other users.
Sorry about that. I'm using a global variable.... Set Variable [ $$SalesID::SL_PKSalesID]
I know that on IWP, the global is for that session... that is the beauty of using a global...
If i switch and use one set field in each of the related layouts/TO i'm going to... how will that effect several users?
They won't be accessing the same records... that is the purpose of the global... to keep them contained...
Can you please post the script step(s) you are using to set the global variable.
As for fields, if you set a non-global field it will lock the record (until the record is committed), but other users will be able to see the change in that field and record (however they won't be able to make changes to the record until it is committed by the original user).
Going back to your original post - are you aware that Data Viewer only shows global variables that are active in your current session? If a global variable is set in an IWP session, you won't see that global variable in the Data Viewer of your FileMaker Pro session - the IWP session is separate from the FileMaker Pro session. Looking in the Data Viewer is not an accurate way of checking whether an IWP script set a global variable (or a global field).
If you want to test within the IWP session whether a variable has been set you can either use a Show Custom Dialog script step to display the variable after you have attempted to set it, or place it as a merge variable on your layout somewhere.
This is it... Set Variable [ $$SalesID::SL_PKSalesID]
I am in the context of the sales layout/TO.
It works on my desktop. i use it to go to other layouts/TO and only show that sales person their info. I put it into every found set... set the sales id and set whatever i'm going into next....
I can use a filtered relationship, but would have to create a TO for each layout...
So my idea is:
These are related records.
I can put the SL_PKSalesID field in the other layouts
Reference that instead of the global $$SalesID in the scripts and live happily ever after
Your Set Variable script step as shown is invalid. It should be something like:
Set Variable [$$SalesID; Value: TableOccurrence::SL_PKSalesID].
I'll assume that is just a typo in your posting, but you'll probably want to double-check it.
What is the process you are using to limit the found set when switching to other layouts? I'm assuming you have a Script (or ScriptTrigger) that does a Perform Find using that global variable? Can you please post the Find you are using?
Its correct, i did not copy it down correctly.
I will set a field in the sales layout with the global to check it.
Its setting it.