Validation Rules
Validation rules verify that the data a user enters in a record meets the standards you specify before the user can save a record. A validation rule can contain a formula or expression that evaluates the data in one or more fields and returns a value of true or false.
Validation rules are retrieved by the CT Mobile app during synchronization as part of the metadata archive and then are applied offline. There are several limitations and conditions for validations applied on mobile devices that consider a correlation between synchronized records and the validation process:
-
Synchronized records cannot be validated before the changes are introduced (on the record layout and custom related list).
-
If changes are made in an already synchronized record, this record becomes unsynced.
Validation Logic for Records
The following logic is applied for Activity records that were created in the Calendar or Nearby Accounts modules.
| The Start/Finish functionality and Lock/Unlock Record must be disabled. |
-
After you create a record and open its layout (an unsynchronized record), the validation is performed on records of all tabs and custom related lists.
-
When a synchronized record is changed, for example, a user changes one of the field values, all tabs will be validated, but records of custom related lists are not affected.
For the Activity records with the Start/Finish functionality and Lock/Unlock Record:
-
Additional validation is performed for the Start Date/End Date fields.
-
If you attempt to leave the unfinished Activity record, the system will prompt a message: “You must finish the activity before leaving the record”.
-
Validation for these Activity records is not prompted until the Activity record is started, even if the record is not synchronized.
Validation Logic for Custom Related Lists
If a record is created or changed on a custom related list, the parent record layout will not be validated.
-
Validation is performed on the Activity record and records of custom related lists when you tap the Finish button on the Activity record.
-
If an error occurs during validation, the system displays a warning message: "Something went wrong on the tab(s): (tab name). Do you want to leave the record or fix it now?" After confirming, the layout or the first custom related list with errors opens.
If you tap the Finish button on the Activity record the system validates the activity and its custom related list. The following principles are applied:
-
All unsynced records are validated when you close the custom related list.
-
Validation is performed only on a particular created or changed record in a custom related list.
-
The new records creation is allowed even if the validation error occurs on a custom related list.
Errors that occur on a record of custom related lists are displayed in a separate section on the Errors screen.
User Permissions
The mobile user should have the following permissions:
-
All fields that are listed in validation rules must be available for editing for a mobile device user, otherwise, they won’t be able to correct the value that might be causing validation error.
-
If a formula field is applied for validation, the data that is used for the formula must also be accessible for editing by a mobile user and loaded to the device for offline mode usage. For example, if the formula references another object.
|
If a formula field in the validation rule is set to perform a comparison of record ID fields with other values specified in the formula the second value must contain the same amount of characters as the first one, i.e. the right and the left parts of the comparison must match. For example, the ID field is compared to a specified ID number or another ID field. |