DmlOptions.AssignmentRuleHeader Class
Enables setting assignment rule options.
The following example uses the useDefaultRule option:
The following example uses the assignmentRuleID option:
The following are properties for DmlOptions.AssignmentRuleHeader.
-
Specifies the ID of a specific assignment rule to run for the case or lead. The assignment rule can be active or inactive.
-
If specified as
truefor a case or lead, the system uses the default (active) assignment rule for the case or lead. If specified, do not specify anassignmentRuleId.
Specifies the ID of a specific assignment rule to run for the case or lead. The assignment rule can be active or inactive.
public Id assignmentRuleID {get; set;}
Type: ID
The ID can be retrieved by querying the AssignmentRule sObject. If specified, do not specify useDefaultRule.
If the value is not in the correct ID format (15-character or 18-character Salesforce ID), the call fails and an exception is returned.
If specified as true for a case or lead, the system uses the default (active) assignment rule for the case or lead. If specified, do not specify an assignmentRuleId.
public Boolean useDefaultRule {get; set;}
Type: Boolean
If there are no assignment rules in the organization, in API version 29.0 and earlier, creating a case or lead with useDefaultRule set to true results in the case or lead being assigned to the predefined default owner. In API version 30.0 and later, the case or lead is unassigned and doesn’t get assigned to the default owner.