function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
koti mulekoti mule 

How can I trigger the Case Assignment Rules for Inline editing the case ??

I have a scenario where the Edit button was removed on the cases, Now When I do some updates through Inline editing on the cases, case Assignment Rules are not firing.
Best Answer chosen by koti mule
viruSviruS
Hi Koti,

Itss not supported by salesforce standard inline editing. https://success.salesforce.com/ideaView?id=08730000000axXtAAI

Workaround : Use Apex like below  on After Trigger of case with specific condition to control recursive execution of trigger 

//anyCondition =  When you wants to execute assingment rule 
if(anyCondition){
//Fetching the assignment rules on case
AssignmentRule  AR = new AssignmentRule();
AR = [select id from AssignmentRule where SobjectType = 'Case' and Active = true limit 1];

//Creating the DMLOptions for "Assign using active assignment rules" checkbox
Database.DMLOptions dmlOpts = new Database.DMLOptions();
dmlOpts.assignmentRuleHeader.assignmentRuleId= AR.id;


Case updateCase = [Select id from case where id = case.id  limit 1];  // Convert the code for bulk data handling
updateCase .setOptions(dmlOpts);
update updateCase ;
}

 

All Answers

viruSviruS
Hi Koti,

Itss not supported by salesforce standard inline editing. https://success.salesforce.com/ideaView?id=08730000000axXtAAI

Workaround : Use Apex like below  on After Trigger of case with specific condition to control recursive execution of trigger 

//anyCondition =  When you wants to execute assingment rule 
if(anyCondition){
//Fetching the assignment rules on case
AssignmentRule  AR = new AssignmentRule();
AR = [select id from AssignmentRule where SobjectType = 'Case' and Active = true limit 1];

//Creating the DMLOptions for "Assign using active assignment rules" checkbox
Database.DMLOptions dmlOpts = new Database.DMLOptions();
dmlOpts.assignmentRuleHeader.assignmentRuleId= AR.id;


Case updateCase = [Select id from case where id = case.id  limit 1];  // Convert the code for bulk data handling
updateCase .setOptions(dmlOpts);
update updateCase ;
}

 
This was selected as the best answer
koti mulekoti mule
Thanks...!
viruSviruS
Let me know if any issues .. if you solved mark solved 
GiuliaMGiuliaM
Hellooooo,
quite a few years later I have the same issue and with that Apex called from a process builder is still working only with the Edit button and not with the inline. Do you happen to have any suggestions?