A Formula test with the FormulaMode property set to OnChange executes a Python script or LiveCode script when a value for a sub-inspection test changes.
Contents [Hide] |
OnChange is intended to execute a script after an inspector modifies a sub-inspection. It only executes a script for a test when certain conditions are met for that test.
Note: If a sub-inspection contains two Formula tests, one with the FormulaMode property set to Pre, and the other set to OnChange, the script set to Pre always executes first.
In PC Collect, Formula tests run Python scripts.
The OnChange event is triggered when any of these conditions are met:
Condition: |
Details: |
Sub-inspection is submitted |
The OnChange formula is executed one last time before any Post formula (if one exists) is executed. |
Checkbox test value changes |
n/a |
DMS Standard test value changes |
n/a |
Pass/Fail/NA test value changes |
n/a |
Rating test value changes |
n/a |
Traceability test (with EntryRestricted property set to True) value changes |
Traceability tests for DMS Event, SPC Event, SPC Cause, and SPC Action Taken do not trigger OnChange events. |
Timer test starts, stops, or counts down to zero |
One of the following occurs:
|
Numeric Input test changes SPC standard |
The user selects a different SPC standard and then clicks OK. |
Numeric Input test value changes |
After changing the value of the test, the OnChange event will be triggered when one of the following occurs:
|
OEE test value changes |
|
Defect List test value changes |
|
Date/Time test value changes |
After changing the value of the test, the OnChange event will be triggered when one of the following occurs:
Traceability tests for DMS Event, SPC Event, SPC Cause, and SPC Action Taken do not trigger OnChange events. |
Traceability test (with EntryRestricted property set to False) value changes |
Each time an OnChange event is triggered, your Python script can check the testid variable to discover which TestID triggered the OnChange event. For more information, see About the TestID property.
In GS Collect, Formula tests run LiveCode scripts.
The OnChange event is triggered when any of these conditions are met:
Test |
When the focus on this test is lost and the value for it changes:* |
When the value for it changes (but it has the focus):* |
When any of these specific conditions are met: |
— |
Yes |
— |
|
Yes |
— |
— |
|
Yes |
— |
— |
|
Yes |
— |
— |
|
Yes |
— |
|
|
— |
Yes |
— |
|
— |
|
||
Yes |
— |
— |
|
*Lost focus: When a user taps a test, that test has the focus until the user taps one of these:
At that moment, the focus on that test has been "lost" – and if the value for that test has changed, the OnChange formula is triggered. |