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
BabbagecBabbagec 

Trouble with useDefaultRule when updating cases

I'm working on an S-control for updating multiple attributes on one or more cases at a time.  The particular problem I'm having is that while I can successfully change the Department_Assigned__c custom field, the assignment rules specified for cases don't seem to be getting applied, and case owner is remaining unchanged.  If I understand the 9.0 Ajax documentation, I should be able to use something like the following:

        sforce.connection.useDefaultRule = "true";
        sforce.connection.update(recordsToUpdate, callback);

If I manually edit a case and change the Department_Assigned__c custom field, the case owner changes correctly.  I've also tried using sforce.connection.assignmentRuleID = "the_assignment_rule_id", but still no luck.  Any tips would be greatly appreciated.
cheenathcheenath
Try this:

sforce.connection.assignmentRuleHeader = {};
sforce.connection.assignmentRuleHeader.useDefaultRule = true;

I think the documentation is wrong, sorry.



BabbagecBabbagec
Thanks so much!  That's exactly what I needed.