Jump to content

On Save: Difference between revisions

From Resco's Wiki
Commands: moving this elsewhere
No edit summary
Line 8: Line 8:
*[[Questionnaire Designer|Questionnaires]]  
*[[Questionnaire Designer|Questionnaires]]  


;Process of On Save execution:
== Saving a record ==
 
To understand On Save rules, it is important to understand how the saving of records works in Resco mobile apps. This is the order of events when saving:
# User initiate saving process.
# User initiate saving process.
# On Save rules are executed.
# On Save rules are executed.
Line 14: Line 16:
# If valid, the record is saved.
# If valid, the record is saved.


==Forms==  
== Display validation problems ==
 
There are two built-in string variables that can be used to display validation problems:
* '''ErrorMessage''': A string variable where you can set an error message for form. In the case of On Save event, this stops the saving.
:{| class="wikitable"
| ErrorMessage || Assign || Web site URL cannot be empty!
|}
 
* '''WarningMessage''': A string variable where you can set an error message for form. In the case of On Save event, this does not prevent saving, user can decide to continue.
:{| class="wikitable"
| WarningMessage || Assign || Web site URL is empty! Continue anyway?
|}
 
== Forms ==  


On Save rule on forms usually serves as a final field validation or they can automate changes in related records.
On Save rule on forms usually serves as a final field validation or they can automate changes in related records.
Line 22: Line 37:
*When you save a record.
*When you save a record.


==Views==  
== Views ==  


On Save rules can be used with [[view]]s, but only when the [[View#Editable_field|Editable field]] is set. (Editable field, list, or editable grid is a feature that allows users to edit one or more records directly from the view, without a need to go to the form of a record.)  
On Save rules can be used with [[view]]s, but only when the [[View#Editable_field|Editable field]] is set. (Editable field, list, or editable grid is a feature that allows users to edit one or more records directly from the view, without a need to go to the form of a record.)  


==Questionnaires==   
== Questionnaires ==   


In inspections, there are two options when to execute On Save rules.
In inspections, there are two options when to execute On Save rules.

Revision as of 06:23, 19 July 2022

Warning Work in progress! We are in the process of updating the information on this page. Subject to change.

The On Save rules are checked when you save a record. Rules are client-side scripts that are executed when a user of the mobile app interacts with the app. Rules are no-code business logic, which are managed using the rules editor, usually in Woodford.

On Save rules are available for the following user interface components:

Saving a record

To understand On Save rules, it is important to understand how the saving of records works in Resco mobile apps. This is the order of events when saving:

  1. User initiate saving process.
  2. On Save rules are executed.
  3. Validation of whether the record can be saved (rules may interrupt save).
  4. If valid, the record is saved.

Display validation problems

There are two built-in string variables that can be used to display validation problems:

  • ErrorMessage: A string variable where you can set an error message for form. In the case of On Save event, this stops the saving.
ErrorMessage Assign Web site URL cannot be empty!
  • WarningMessage: A string variable where you can set an error message for form. In the case of On Save event, this does not prevent saving, user can decide to continue.
WarningMessage Assign Web site URL is empty! Continue anyway?

Forms

On Save rule on forms usually serves as a final field validation or they can automate changes in related records.

Rule execution
  • When you save a record.

Views

On Save rules can be used with views, but only when the Editable field is set. (Editable field, list, or editable grid is a feature that allows users to edit one or more records directly from the view, without a need to go to the form of a record.)

Questionnaires

In inspections, there are two options when to execute On Save rules.

Rule execution
  • When you save the questionnaire
  • When you complete the questionnaire

This behavior is configured on the questionnaire level, in the Validate On property.