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
SrinuSrinu 

Preventing Assignment Rules executing upon case edit !!

Hello,

We recently created one record type and page layout for case object. Upon case creation we wanted to fire Active assignment rules and by selecting the "Assign using active assignment rules" optional check box we are able to acheive it. Case is getting created successfully and assgned to Queue. 

But upon case EDIT also Assignment Rules are firing since we have selected 'Default' ceckbox for Assignment Rules on page layout level. That's the reason why AR are firing. We don't want AR firing upon case edit? What actions do I need to take to prevent this?

Any suggestions plz..

Thanks,
Srinu
Mahesh DMahesh D
Hi Srinu,

The below will resolve the issue but not sure whether we have any other option here.

As part of the Case creation change the records type id to a new record type and it gets assigned to new page layout which will not have AR checkbox selected.

This will resolve the issue but here we are creating on additional Record Type and Page Layout.

Please check if any other options available and take a call on the above solution.

Regards,
Mahesh
Vijay NagarathinamVijay Nagarathinam
Hi Srinu,

If you want to fire the assignement rule for record creation not record edit, you can acheive this by using before insert trigger. It is not possible to acheive this in configuration level.

Use below sample code and implement your logic.
 
Database.DMLOptions caseAssignmentRuleOptions = new Database.DMLOptions();
 caseAssignmentRuleOptions.assignmentRuleHeader.useDefaultRule = true;
Id devRecordTypeId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('Development').getRecordTypeId();

for(Case newCase : Trigger.new){
Case newCaseRec = new Case(); 
	if(devRecordTypeId == newCaseRec.RecordTyeId){
	newCaseRec.setOptions(caseAssignmentRuleOptions);                         
	}
}

Thanks,
Vijay

 
Raviteja Gandhari 7Raviteja Gandhari 7
Hi Srinu,

You can follow these steps.

1. Enable "Assign using active assignment rules" checkbox on page layout and remove it from the layout. It ensures assignment rules are always fired on case creation.
2. Create a custom checkbox field on case object like "StopAssignmentRule__c" and put default value as ''checked". Remove this from layout.
3. In your assignment rule add one more condition like "StopAssignment equal True".
4. Create workflow rule with "create only" and field update which updates the checkbox value to false.

Please let me know if you have any questions acheiving this.

Thanks,
Raviteja
sagarvp9sagarvp9
Below is the simple solution to Avoid Assignment Rules to Fire during Case/Lead Update through configuration:-
On Case/Lead Assignment Rule Entry, enable Do Not Reassign Owner checkbox.

User-added image

 
Efraim Taranto 6Efraim Taranto 6
In our case, we are using a formula: (ISNEW() ||ISCLONE()) && ISPICKVAL(Type, 'Data Integrity')

User-added image
Tony ParfittTony Parfitt
For those who downvoted the solution provided by sagarvp9, perhaps it is not well explained how to use this. Put a rule at the top of your rules for cases that are status not equal to new, with the do not reassign owner checkbox checked. So when a case that is not new is edited, it hits this rule which does not reassign the case, then ignores all other rules. Far simpler than messing around with record types etc.
Balink 8Balink 8
I want to add that it is also possible to add a last stage in the assignment rule without a criteria, and to check the "do not reaasign owner". That way, even if the case assignmemt rule is fired after trigger, it will not affect the case's owner as long as the record doesn't answer none of the entries in the assignment rule.
James KohlmillerJames Kohlmiller
The answer from sagarvp9 is great. By clicking "Do Not Reassign Owner" you are telling it to assign the Case to the current User. So if you create a Rule with criteria that should not reassign the Case(s) and put it at the top of your Rules - it should prevent your Assignment Rules from running when you do not want them to. Based on either the Reasons, Status, Priority, etc. Custom fields work too.
pav kumpav kum
Hi james,
even im also facing the same issue pn before update,before insert trigger.
so do i need just to enable the checkbox or do i need to create a separate rule then i have to check the checkbox?
im not gettong on how to setup this settings?
Tom EastwoodTom Eastwood
I assist students with their academic tasks and guide them in all types of academic work. And offer assignment help, thesis help, essay help, homework help (https://www.globalassignmenthelp.com/us/homework-help), etc. My team members are subject experts and highly experienced. We offer the best quality guidance and assistance.