Validation Rule Configuration

Validation Rule Configuration

The Payology Check Scanning App allows for on-screen validation of each check row within the check grid. Salesforce Developers and Administrators can choose to use out-of-box validation rules and/or custom validation rules created via APEX Class methods.

On selection of Validation Rules, a search is initiated and APEX Classes using the method outlined begin to appear within the configuration grid. An Administrator can then choose to enable or disable the validation rules which appear.

Sample Validation Rule

Below is a sample of a Validation Rule APEX class which ensures that the Account Number of a check is at least 5 characters in length.

global with sharing class C21ValidationStandardAccountFiveDigits implements C21ValidationRule {
    private checkforce2__Config__c configData;
    public C21ValidationBuilder validate(String check) {
        C21ValidationBuilder vb = new C21ValidationBuilder(check, configData);
        String accountNumber = (String)vb.getCheckObj().get(vb.getCheckObjectNamespace() + 'Account_Number__c');
        accountNumber = String.isBlank(accountNumber) ? '' : accountNumber;
        return (accountNumber.length() < 5) ? vb.returnWithError('Account Number must have at least 5 digits') : vb.returnOk();
    }
    public String getDescription() {
        return 'Validate if the Account Number has more than 5 digits.';
    }
    public C21ValidationRule setConfigData(checkforce2__Config__c configData) {
        this.configData = configData;
        return this;
    }
}

Streamlining Validation Rule Configuration Promotion to UAT or Production

To streamline the promotion of the configuration settings from Sandbox to UAT or Production, each step of the configuration process includes an "Upload" and "Download" button. When clicking the "Download" button, a JSON file will be provided to the user. This JSON file can then be uploaded in UAT or Production environments by clicking on the configuration step and selecting the "Upload" button, choosing the downloaded file as the final step. Please ensure you are uploading and downloading the correct JSON file for each step of the configuration process.

Next Steps

The completion of the Validation Rule Configuration process ends the configuration of the Payology Check Scanning App. Salesforce Administrators, Developers, and Users should attempt to familiarize themselves with the Check Scanning User Interface. For detailed information on the Check Scanning User Interface and its usage, please see the next section, labeled Using the Check Scanning App.