Checking to See if the Database is Configured to Include Job Manager (PS.HasJM)
Use the PS.HasJM function in the PS.js Professional Services library to check whether or not the database is configured to include Job Manager.
Description
The PS.HasJM function returns the boolean value true if the current database is configured to include the Job Manager application. This can be used to conditionally execute MetaScript code appropriate for the current database.
Usage Notes
This function can be used in a form's Global MetaScript and elsewhere.
To call this function, the PS.js library must be added to your database as a stored script and referenced in the form's Global MetaScript (//@include "database:PS.js"). See here for instructions.
Function Syntax
PS.HasJM()
Examples
A simple example that uses PS.HasJM in a button's Click Action Script to determine whether or not the current database includes Job Manager and display an alert box with its determination.
if ( PS.HasJM() ) { alert ( "This database includes Job Manager" ) } else { alert ( "This database does not include Job Manager" ) }