Working With Data Validation Options
If your organization's needs require a level of data validation beyond what is available by default in Max, you can perform custom configurations. For best results, complete these configuration steps after you test and run initial sync, and before you configure and test real-time sync.
Data validation is accomplished on the Max platform in several different ways. For the simplest and most common validations, you can enable or configure predefined metadata at the field and data type levels. For more complex validation requirements, you can develop custom validations at the record, field, and relationship levels.
Custom validation at the record level is triggered by an operation configured in Object Validator records that are related to specific records of various object types. Multiple operations can be triggered through this relationship to perform various custom validations, with validation errors and warnings captured in a separate object. At the field level, you define custom validation by creating an Operation record that you then relate with the field. Only single operations can be triggered through this relationship. At the relationship level, you can configure a Relationship Validator record to trigger custom validation whenever records of two specific types are linked or unlinked. You can configure a confirmation message to appear if warnings are generated when dispatchers create or update appointments.
Predefined validations are available for fields and data types. In the Field object, you can set the Required flag to make the field mandatory, so that records cannot be saved if the field value is null. You can also set the Immutable flag to make the field read-only after it is populated during record creation. Additionally, each Field has an associated Datatype object. Each data type has an associated Datatype Options record that supports a variety of predefined validation mechanisms. To enable and configure these field options, the Active flag must be set in the associated Field Options record.
Data Type Option
Validation
Associated Data Types
Maximum Value
Maximum acceptable value for the field.
Number
Integer
Percent
Quantity
Maximum Amount
Minimum Value
Minimum acceptable value for the field.
Number
Integer
Percent
Quantity
Minimum Amount
Unique
Constrains each value in the field to be unique.
Number
Integer
Percent
String
Email Address
Maximum Length
Maximum acceptable string length for the field.
* 
For Appointment Name or Event Name field options, you can configure a Maximum Length value of any length. However, for ServiceMax Event records, the maximum acceptable value for this field option is 80 characters. If you configure a value that is longer than 80 characters for this field option, the value is truncated to 80 characters.
String
Text
Hashed Password
Before
Earliest acceptable date, time, or timestamp value for the field.
Date
Time
Timestamp
After
Latest acceptable date, time, or timestamp value for the field.
Date
Time
Timestamp
Allowed Units
Acceptable unit or units for the field.
Quantity
Interval
Max Height
Maximum acceptable image height in pixels for an image field.
Image
Max Width
Maximum acceptable image width in pixels for an image field.
Image
Maximum Size
Maximum acceptable file size in megabytes for a field.
File
* 
Custom data validation relies on Groovy source code. For Groovy source code class definitions and examples, see Custom Data Validation Source Code in Max for Developers.
For more information:
Was this helpful?