I have an application with script steps where I PSOS. I need to know if my application is running as a local file or if its running on AWS Cloud. Is there a method to detect the environment host?
Get(HostApplicationVersion) returns "Cloud Server 22.214.171.124" for the current version.
I'd also suggest checking Get(LastError) after a PSoS script step, since it can fail for various reasons, even when hosted.
To determine local file, you can also use Get(HostIPAddress), empty when not hosted.
Get( ConnectionState ) < 1
"Cloud Server 126.96.36.199"
So the 16 is for server 16?
and x.17.xxxx for Server 17 ?
So if I want to hide a print button on a WebDirect layout when printing is not available.
Checking for Server 16 and Cloud Server 16 and up would cover all the possibilities?
Are you trying to hide the button on web direct or any server v16?
Maybe Get(SystemPlatform) might be better?
I don't know what server the user will host my file on.
The file has dedicated WebDirect layouts that have "Print" buttons.
I want to hide these Print buttons when the Server doesn't support WebDirect printing.
Seeing as if Get(SystemPlatform) = 4, then it is running on WebDirect, then it follows that it must also be a FMS/Cloud hosted file that is open rather than a local file as WebDirect requires FMS/Cloud... So you then just need to check which FMS/Cloud version number it is running on, e.g. that it is minimum v16 for FMS, and v1.16 for Cloud, so your 'Hide object when...' calculation could be something like:
Get(SystemPlatform) = 4 and
If ( LeftWords ( Get(HostApplicationVersion) ; 1 ) = "Server"; // is running on FMS, not Cloud
GetAsNumber ( Get(HostApplicationVersion) ) < 16; // FMS older than v16
GetAsNumber ( Get(HostApplicationVersion) ) < 1.16 // Cloud older than v1.16
Sky has a good solution for you.
Thanks for the reply and the solution!
Retrieving data ...