Mobile Validations

Prerequisites

  • To set up validation rules, you need:

    • Minimum permissions for the FieldFX modules you are using

    • System permissions:

      • API Enabled

      • Author Apex

      • Customize Application

      • View Setup and Configuration

Basics

  • Validation rules improve data quality by preventing users from saving invalid data.

  • Use validation rules to:

    • Force users to enter values within an acceptable range.

    • Force users to enter date ranges in chronological order.

    • Make fields conditionally required depending on the value of another field.

How it Works

  • Validation rules run when you save a record:

    • If the record passes validation, the record saves.

    • If the record doesn’t pass validation, a warning displays and you can’t save the record until you enter valid data or discard your changes.

  • Validation rules also run when you change the status of a record:

    • If the record passes validation, the record transitions to the new status.

    • If the record doesn’t pass validation, a warning displays and you can’t change the status until you enter valid data or discard your changes.

  • While validation rules can work in either FieldFX Back Office or FieldFX Mobile, this tool is specifically for creating validation rules for FieldFX Mobile.

    To create validation rules for FieldFX Back Office, see Validation Rule Setup.

  • Validation rules can be added for the following objects:

    • Job

    • Quote

    • Quote_Item

    • Ticket

    • Ticket_Item

    • Ticket_Log

    • WorkOrder

    • WorkTask

    • WorkTaskStep

    • eForms with an eForm configuration

  • Each object can have an unlimited number of rules.

Creating Mobile Validation Rules

Static Resource File

  • Mobile Validations work by looking for a Static Resource file called FX_Mobile_Rules.

  • If this file already exists, skip to selecting an object.

  • If the file does not exist, start by importing objects and rules from Back Office.

Import Existing Back Office Rules

  1. Go to https://admin.fieldfx.com and log in to the Sandbox or Production org to use for the validations

  2. Under Option 2, click Import

    Screenshot showing that importing validation rules from FieldFX Back Office is the only available option if the static resource file does not yet exist
  3. Select FieldFX Back Office rules and objects to import to the Mobile Rules file, then click Next

    Select as many objects as needed.

    Use the search bar to find the object to Import by an existing rule.

    Screenshot showing objects selected for importing rules

    Rules that already exist for mobile display in a grayed-out list and cannot be selected for import.

  4. Select the FieldFX Back Office rule(s) to import to the FX Mobile Rules file, then click Import

    Screenshot showing rule selected for import

    The Mobile Validations tool completes the Import and returns to the landing page.

Create a New Rule

  1. Go to https://admin.fieldfx.com and log in to the Sandbox or Production org to use for the validations

  2. Click Mobile Validations

  3. In Object, select the sObject for the rule, then click New

    If the FX_Mobile_Rules Static Resource file does not exist, complete the Import steps described above, then proceed.

  4. Make the following entries:

    • Rule Name (required): unique name for the rule on this object

    • Status: Select the Active checkbox when the rule is ready to apply

      Deselect the checkbox to temporarily disable the rule.

    • Error Message (required): message to display to the user if the validation is not met

    • Error Location: select Top_of_Page to show the message in a banner at the top of the user’s screen

      or

      select Field to show the message below a specific field on the user’s screen, then select the field the user needs to correct

    • Error Condition Formula (required): SOQL formula that must evaluate to TRUE for the rule to be met and the record to save

    • Validation Description: description of the rule

  5. Click Save

Example 1. A validation rule for the Price Book lookup on the Job object.

This rule forces users to select the customer’s price book when adding a job.

Screenshot of the configured validation ruke

Modify an Existing Rule

  1. Go to https://admin.fieldfx.com and log in to the Sandbox or Production org to use for the validations

  2. Click Mobile Validations

  3. In Option 1, select the sObject for the rule to modify

    Selecting an object under option 1
  4. Select the rule to modify

    Screenshot of a cursor over a rule to select
  5. Make any of the the following entries:

    • Rule Name (required): unique name for the rule on this object

    • Status: Select the Active checkbox when the rule is ready to apply

      Deselect the checkbox to temporarily disable the rule.

    • Error Message (required): message to display to the user if the validation is not met

    • Error Location: select Top_of_Page to show the message in a banner at the top of the user’s screen

      or

      select Field to show the message below a specific field on the user’s screen, then select the field the user needs to correct

    • Error Condition Formula (required): SOQL formula that must evaluate to TRUE for the rule to be met and the record to save

    • Validation Description: description of the rule

  6. Click Save

Delete a Rule

  1. Go to https://admin.fieldfx.com and log in to the Sandbox or Production org to use for the validations

  2. Click Mobile Validations

  3. In Option 1, select the sObject for the rule to modify

    Selecting an object under option 1
  4. Select the rule to modify

    Screenshot of a cursor over a rule to select
  5. Click Delete

    There is no confirmation, and the rule cannot be recovered once deleted.