AdvoLogix Help

Processing an Assignment Rule Set via Code

Updated on

The following Apex method can be used create a new document via custom coding. Please be aware this method requires knowledge of Force.com best practices and as always we suggest testing your code in the Sandbox.

Syntax:
AssignmentRulesService.processRule(
@ruleId,
@listOfRecordIds
);

 

Parameters:
@ruleId 
Required. The Assignment Rule Set Id to be used for processing the source record for predefined assignment actions.

@listOfRecordIds
Required. The list of Id value of the base object's source records for which Assignment Rule Set should be processed for.

Result:
The function call will return a JSON formatted string in this format: {success:"",result:""}

success
Will be either TRUE or FALSE

result
A confirmation text of completion OR error text if the process is halted by an unexpected error.

Example:
AssignmentRulesService.processRule(
   'a0b9000000RJhKT',
   new list<Id> {'a0d9000000GTrsg', 'a0d9000000GTrqa'}
);

Previous Article Processing an Assignment Rule Set via Process Builder
Still need help? Click here!
AdvoLogix® is a registered trademark of AdvoLogix.com LLC a Texas Limited Liability Company. All references to other trademarks belonging to third parties that appear on this website, documentation, or other materials shall be understood to refer to those registered trademarks owned by others, and not to any trademark belonging to AdvoLogix. Otherwise, all material herein is the copyright of AdvoLogix.com LLC. All Rights Reserved.