Validation Rule Action

Validation Rule Action allows apply complex validation rules. User can configure rules and when they are met system fill through exception message.

If the rule is a part of the Action Group and Validation fails - other actions in the group will not be executed.

  • Add an action with the type Validation Rule (1).

  • Enter "Error message". This text will be shown to the user if conditions entered are true. (2)

  • Enter rules for Validation rule to fire. Select the type: Query, Formula or Apex Call. See example below. (3)

Each type allows to specify rules in specific way: see more details on Working with Conditions and Working with Actions articles.

  • Save (4) the Action. Now you can call it from Kanban and other arias.

Apex type validation rule

Working with Call Apex

  • Select Call Apex validation rule type.

  • Select the Class Name in the drop-down. If you don't see your class in the drop-down, use Filter option.

  • Enter Parameters in a JSON format.

Your custom Apex Class should implement FLX_KB.KanBanInterfaces.ApiInterface interface.

Note: In Global Action pass required "methodName" and "parameters" params to custom apex when using FLX_KB.KanBanInterfaces.ApiInterface.

For validation rule with Call Apex type "methodName" parameter should be set to "Rule".

Below is an example of an apex class that is used to execute apex rule.

Call method should return boolean. If call method returns 'true' conditions will not be met and rule will throw error, further actions won't be executed in case action is a part of Global Actions Group.

With the above setup rule will throw error when Account Prone is blank.

public with sharing class FLX_ApexRules implements FLX_KB.KanBanInterfaces.ApiInterface {

    public Object call(String methodName, Object parameters)
    {
        Map<String, Object> params = (Map<String, Object>)parameters;
        if(params.get('value') != null) 
            return false;
        else
            return true;
    }
}

Last updated