Just an idea that could be part of the problem - When a script is run from the server the starting context may be different. eg. If you run a script from a particular layout and if the script assumes that layout as the starting context, when run from the server it will open the file and whatever layout is the layout opened by the file would then be the starting context. You need to make sure you specify the context in your script by going to the required layout.
We can probably help you more if you post the script so we can have a look at it for you.
Thanks Chris, it does go to the correct layouts right away. I've attached my script, but I can tell that the error is happening somewhere before the Exporting step at the end.
Export HAY Script.pdf 81.6 K
Hi Ben - can't say for sure this will solve the problem, but have you tried an explicit Commit Records script step after all the set fields steps and before the step to:
Go to Layout [ “RawData” (RawData) ]
Also, not sure why your set field step at the end of the script is disabled? Is that an issue?
// Set Field [ Signon::Last Export Time ; Get(CurrentTimestamp) ]
I will definitely try to commit the records. I disabled it recently because I wanted to make sure records would show up when I run this. Essentially it looks to see if there are any records that have changed since the last run time, and exports them. At the end, I set the last run time to the time the script ends. So while I am troubleshooting, I don’t reset the time because I, again, want to make sure that there are records for it to find.
I’ll let you know what happens when I try the commit records step.
I hadn't tested it myself yet, but just read in Import XML - specify source
that you can't contain "filewin:" or "filemac:" part in variable when used on server side script. Try using
It sounds as a bug for me...
Maybe I missed something.. but:
Where is $$Year defined?
A ServerScript will log in virtually - means no scriptvariables (the $ var is declared at the top, but with a new login, $$ are empty - they are per user and per session)
I think you hit, $$ should be set from script paramter.
Or, it can be set in on(First)WindowOpen trigger script.
Thank you all! Yes, the problem was the $$Year variable isn't set on my first window open option. It is set when I go to a layout which doesn't happen on the server side.
I changed this to set the variable on the first window open and it is working! I can't believe I missed that one.
Thanks again user19752 and @Markus Schneider.