Formula test

Note: Not all of the sub-inspection test toolbar buttons are technically "tests." For simplicity, that term is used to describe all of the sub-inspection test toolbar buttons.

The Formula test executes Python™ script (for PCs) or LiveCode (for iPads) to customize the inspection. Using this feature is recommended only for use by Hertzler Systems technical experts or others who are well-versed in programming methods and languages.

 

Contents  [Hide]

 

Adding a Formula test to a sub-inspection

  1. Click the Formula test toolbar button to add this test to the sub-inspection.

  2. Set any properties for this test on the Properties panel that displays after the test is added.

For information about using the Properties panel, see Changing property settings.

Formula test properties

Property

Field type

Default setting or default display

Allows

APPEARANCE

Label

Text field

[blank]

Enter text for a label and formula description.

BEHAVIOR

FormulaMode

Multiple choice

Pre. Executes the formula before the operator can interact with the sub-inspection.

A Post formula is executed when the inspector clicks Submit.

Click displays a button the inspector taps to run a formula. For this to properly function in GS Collect, the FormulaLocation property must be set to Local.

An OnChange formula is executed when another test on that sub-inspection meets certain conditions. When the user clicks Submit, the OnChange formula is executed before any Post formula (if one exists) is executed.

Cancel [PC only] executes the formula when the sub-inspection is cancelled (but before any final OnChange formula is executed). If the PC Collect module displays the warning message about unsaved data being lost, this formula will be executed after the user clicks Yes to exit.

MOBILE

FormulaLocation

[Mobile only]

Multiple choice

Local. Uses the mobile device to execute the formula.

RunAtServer executes the formula using the server associated with the device.

SqlAtServer executes the formula using the server’s database. Updates and deletions are not tracked in the Audit Trail.

Also see FormulaMobile property.

FormulaMobile

[Mobile only]

Code

[blank]

Enter LiveCode code or the SQL statement depending on the FormulaLocation property value.

Add a command line to run when the FormulaLocation property is set to RunAtServer.

You can double-click on the Formula test to edit the LiveCode code.

PC

PythonScript

[PC only]

[Blank]

[Blank]

Use the Python Script Editor to create, edit and debug a Python script.

You can double-click on the Formula test to edit the Python script or choose a different script.

TestID

[PC only]

A unique TestID number is automatically assigned to each test in the inspection, but you can change this number to a more meaningful name.

The value of the TestID property in a Formula test is used when the FormulaMode property is set to Click.

See About the TestID property and testid Python variable.

Related topic