on which Layout should we test, is it trial Web Main List ? There I filled all of the fields and clicked on the button and the record was added. Then I used the script debugger, nothing is executed. You test the value of $$PLATFORM, but you never set it's value as far as I can tell.
I got an email stating you replied, but the link does notwork .
You're right in starting the name of your value with $$, this way it's global and is accessible in any script.
You need to set this variable when the file is loaded. Create a script, lets say it is called OnOpen, that will be executed when the file starts. To know what platform the user is on, use Get(ApplicationVersion). This will return:
Pro or ProAdvanced, the you are on a desktop
Go_iPad for an iPad
Go for an iPhone or iPod
See the help for more information on this function. Depending on the value returned by Get(ApplicationVersion), set $$PLATFORM accordingly. Once the script is written, go to File > File Options... Activate the Script Triggers tab, and assign OnOpen script to Event OnFirstWindowOpen. You're all set .
Sometimes in the starter solutions there is an assumption about the way a user will navigate around. In one solution I remember a similar issue that relied on a global variable being set, but if the user navigated without using nav buttons then it didn't get set and then subsequent scripts didn't function as expected. I suggest you go back to the starter solution you began with and see if you can work out how the global variable gets set there. Maybe you will also need to copy over the script which sets the $$PLATFORM variable. You could just import this and set it to run OnFirstWindowOpen. Or you might be able to implement a better way in your own solution. The variable is really just detecting the type of device you are on, then the script you are already working with is navigating to an appropriate layout for the platform.