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
AvisheKAvisheK 

Case Assignment Rule not firing through Apex Code after Winter 10 release in sandbox

Hi,

 

I have written an Apex Trigger which would automatically make the Case Aggignment Rule fire upon update of records either through front or back end using the AssignmentRuleHeader. This trigger was firing properly in the sandbox before the Winter 10 release came into effect. This code is still firing properly in Production which has not yet been upgraded to the Winter 10 release.

If anyone has faced a similar issue, and found a resolution, please provide me the same.

 

Thanking you in anticipation,

AvisheK

paul-lmipaul-lmi
i ran into this issue before winter '10 , and had to essentially re-update the case with the DMLOptions in place, in the Apex code.  what's your trigger look like?
AvisheKAvisheK

My trigger on the case object is already an after update trigger. I am taking the Id of the case and excuting a SOQL statement to pick populate a list with the Cases.

 

The code that I am using is provided as below.

 

List<Id> str_ID=new List<Id>{};
for(Case c:Trigger.new) {
    str_ID.add(c.Id);
}
if (runAssignmentRule.isRun<>true) {
    Database.DMLOptions dmo = new Database.DMLOptions();
    dmo.assignmentRuleHeader.useDefaultRule = true;
    List<Case> lst_Case=[select id,OwnerId,Change_Owner__c,RecordType.Name,Market_Origin__c from case where id in:str_ID];
    runAssignmentRule.setIsRun();
    for (Case c:lst_Case)
    {
        if (c.RecordType.Name.contains('Investigation') || c.RecordType.Name.contains('Client Close') || c.RecordType.Name.contains('Staff Account Setup') || c.RecordType.Name.contains('Trader Call Program') || c.RecordType.Name.contains('Complaint') || c.RecordType.Name.contains('Collections') || c.RecordType.Name=='Compliance' || c.RecordType.Name.contains('Awaiting Funds') || c.RecordType.Name.contains('Maturing Contracts') || c.RecordType.Name=='File Review' || c.RecordType.Name.contains('FXOPS PQ') || c.RecordType.Name.contains('Salesforce Issues') || c.RecordType.Name.contains('Refund') || c.RecordType.Name.contains('Query') || c.RecordType.Name.contains('Change of Bank Details') || c.RecordType.Name.contains('Return of Funds') ) {
        } else {
            if (c.Change_Owner__c==false) {
                c.setOptions(dmo);
            }
        }
    }
  
  try {
        update lst_Case;
    }catch(Exception ex) {
        system.debug('%%%%%%%%%%% Error :' + ex.getMessage());
    }
}

 

 

 

paul-lmipaul-lmi
nothing looks awry there.  i'd open a ticket with support asap on this, and hopefully they won't break your trigger (and my apex class doing the same thing) with the winter rollout to production.