Mobile Validations

Introduction

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

You can 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.

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

How Validation Rules Works

Validation rules run when:

If the Validation Passes…​ If the Validation Fails…​

Saving a Record

Record Saves

A warning displays and you can’t save the record until you enter valid data or discard your changes.

Changing a Record

The record transitions to the new status.

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

  • Each object can have an unlimited number of rules.

Step-by-Step Guides

Before you can use a Mobile Validation Rule can be created, the FX_Mobile_Rules Static Resource file must exist.

To work, Mobile Validations look for a Static Resource file called FX_Mobile_Rules first.

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.

Getting There

  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. You can create, modify, or delete existing rules.

Create a New Rule

  1. 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.

  2. Make the following entries:

    Field Action / Description

    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.

  3. 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 rule

Modify an Existing Rule

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

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

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

    Field Action / Description

    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)

    The 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.

  4. Click Save.

Delete a Rule

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

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

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

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