detectScreen( id1, value1, id2, value2, etc. )



This function detects if the user is currently on a specific screen. It can be used inside a JavaScript if statement. If the screen is successfully detected, true is returned. Otherwise, false is returned.

Parameters:

  • id1 - id of output element to check; the element should be a constant field

  • value1 - constant value to look for in the element

  • id2 - id of second element to check (Optional)

  • value2 - value to look for in the second element (Optional)

Example:

The following code automatically presses the enter key on the Confirm Invoices screen.

if (detectScreen("D_1_2", "INV011FM", "D_1_35", "Confirm Invoices")) { pressKey("Enter"); }