If System::Var is not a field with global storage, the value in the field may not be accessible from every layout in your file. Whether or not it is depends on any relationships you have defined linking it to the layout that is current at the time your script is performed. Also, if it is not a global field and you have more than one user accessing the database at the same time, the data from one user will replace that of the other.
Instead of adding a bunch of relationships between System and your other tables, make Var a field with global storage or use a $$GlobalVariable instead of a field to hold this value. Either a global field or a global variable will hold data specific to each user so this also solves the issues that can occur when you have more than one user connected to your database at the same time.
the first two buttons I wrote this:
Set Variable [$$System; Value:1]
Go to Layout ["Main" (table)]
Set Variable [$$System; Value:2]
Go to Layout ["Portable" (table)]
And for the script on the list: