Default Values and Validation Rules

You can configure string and integer fields to include default values and validation rules. This helps when your business needs some fields to be populated by default and some fields to be calculated automatically, based on the value of another field. Further, this function is allowed only for `string`, `int` and `enum` custom properties.

You can configure the fields and properties in these ways:
  • Add a default value: A default value is an auto-calculated value of a field or property. This value is based on certain business rules and is dependent on the values of other fields and properties. The default value is represented as formula filled in the corresponding configuration field. For example, when a property is filled with a specific value, another property is filled with the current date or time.

  • Add a validation rule: A validation rule is a restriction based on certain business rules and is dependent on the values of other fields and properties. A validation rule is represented as a formula filled in the corresponding configuration field. For example, the value entered for a property (property A) falls within a specific range (between values of property B and property C).

  • Use a formula for configuring the visibility and the value visibility: The formula is based on certain business rules and is dependent on the values of other fields and properties. The formula for the visibility of the field and its value must be filled in the corresponding configuration field. It's possible to transform an existing visibility configured through a constructor to a formula. The application uses this formula for calculating visibility as the primary path and visibility from the constructor as the secondary path.

Note:
  • If a default expression is configured with an empty value for a read-only field or property, it will NOT be hidden on the page. This means, the user will see the field or property name on the page, but it will not have any value.

  • For read-only fields, default values take priority over calculated values.

Auto-Generated and Auto-Calculated Fields

Auto-generated and auto-calculated fields can have a visibility of Read-Only. Regardless of the configured visibility, the application displays such fields as Read-Only. Further, such fields are not available for selection on the Context Layout Structure page of add pages such as, 'Add activity' and 'Add inventory'. The fields that can be set only as read-only are as given in this table:
Entity Field Description
ACTIVITY ETA Estimated time of arrival
acoord_status Coordinate status
acoord_x Coordinate X
acoord_y Coordinate Y
activity_alerts Activity alert
activity_capacity_categories Activity capacity categories
activity_compliance Activity compliance
activity_workskills Activity work skills
aid Activity ID
astatus Activity status
atravelarea Travel area
atype Activity Type
auto_routed_to_date Auto-routed to date
auto_routed_to_provider_id Auto-routed to Provider ID
auto_routed_to_provider_name Auto-routed to Provider name
aworkzone Work Zone
date Date
delivery_window Delivery window
end_time eta_end_time Estimated end time
first_manual_operation First manual operation after the automatic operation
first_manual_operation_interface First manual operation done through the interface after the automatic operation
first_manual_operation_user_id First manual operation done by (user ID) after the automatic operation
first_manual_operation_user_login First manual operation done by (user's login) after the automatic operation
first_manual_operation_user_name First manual operation done by (user name) after the automatic operation
service_window Service window
time_delivered Time of delivery
INVENTORY inv_aid Activity Id
inv_change_invid Changed Inventory ID
inv_pid Resource Id
invid Inventory Id
invpool Inventory pool
REQUIRED INVENTORY required_available_quantity Quantity in Resource Pool
required_model Model
required_quantity Quantity
required_type Type
SERVICE REQUEST appt_ident Activity
srcreated Created
srdate Date
srid Id Request Id
sr_aid Activity
sr_invid Inventory Id
sr_pid Resource Id
sr_uid User Id
uname User
RESOURCE alerts (always hidden)
calendar Calendar
oncall_calendar On-call calendar
pcapacity_bucket Capacity area
pending Pending activity
pid ID
pinitial_ratio Initial ratio for activity duration
p_rprid Routing profile ID
queue_status Queue status
reactivated Reactivated
resource_capacity_categories Capacity categories
resource_effective_workskills Effective work skills
resource_time_slots Time slots
resource_workskills Work skills
resource_workzones Work zones
skip_days_for_stats Working days left for reported data to start impacting duration estimation
total Total
pcolor (always hidden)
USER last_login Last login
last_password_change Last password change
login_attempts Login attempts
login_blocked_to Login blocked to
main_resource_id Main resource ID
mobile_activity_count Mobile activity count
mobile_inventory_count Mobile inventory count
mobile_provider_count Mobile provider count
show_placeholder_id Show placeholder ID
sucreated Registered
sustatus Status
suupdated Updated
uid User ID

Limitations

These limitations exist for default values and validation rules:
  • Work skills and work zones are not supported for default values and validation rules.

  • Custom properties with the "Geolocation element" GUI is not supported for default values and validation rules.

  • These limitations are applied to the configuration of expressions:
    • 2000 characters for configuring default values

    • 2000 characters for configuring validation rules

    • 4950 characters for configuring visibility as an expression

Supported Pages

You can configure default values and validation rules only on these Activity and Inventory pages:
Page Label
Edit/View activity mobile_activity_details
Cancel activity mobile_cancel_activity
Delay activity mobile_delay_activity
End activity mobile_end_activity
End prework mobile_end_prework
Not done activity mobile_notdone_activity
Add activity mobile_set_activity
Start activity mobile_start_activity
Start prework mobile_start_prework
Suspend activity mobile_suspend_activity
Add/Details inventory mobile_add_details_inventory
Deinstall inventory mobile_deinstall_inventory
Install inventory mobile_install_inventory
Send/View activity request mobile_activity_request
Add/View inventory request mobile_inventory_request
Add/View resource request mobile_provider_request
Edit Required Inventory mobile_add_edit_required_inventory

Supported Fields

You can configure default values and validation rules only on these fields:
Property name Property label Type Entity GUI
Account Number customer_number field activity text
Activity Type aworktype field activity combobox
Address caddress field activity text
Appointment Number appt_number field activity text
City ccity field activity text
Customer Email cemail field activity email
Customer Mobile Number ccell field activity phone
Customer Phone Number cphone field activity phone
Duration length field activity text
Inventory Type invtype field inventory combobox
Name cname field activity text
Points apoints field activity text
Quantity quantity field inventory text
Serial Number invsn field inventory text
Service Request Type srtype field service request combobox
State cstate field activity text
ZIP/Postal Code czip field activity text

Calculation Order

The result of a configured expression is calculated in this order:
  1. Value (Number, String, variable, function, expressing in round brackets)

  2. Special operators (BETWEEN, IN, CONTAINS)

  3. Unary operators (NOT, -)

  4. Multiplicative operators (*, /)

  5. Additive operators (+, -)

  6. Comparison operators (=, <>, <, >, <=, >=)

  7. Logical operator AND

  8. Logical operator OR