You need to sign in to do that
Don't have an account?
Conrad Jooste
Case trigger help
I'm trying to put in place a basic trigger for the auto 'assignment of cases' via communities to ensure that they use the default rule & so that I can remove this checkbox "Assign using active assignment rules" from the page layout.
Here's the trigger code, but it doesn't seem to be working. Any ideas?
**********************************************************************
trigger CommunityCaseAssignment on Case (before insert) {
for (Case c: Trigger.new) {
if (c.Origin == 'Community') {
Database.DMLOptions dmlOpts = new Database.DMLOptions();
dmlOpts.assignmentRuleHeader.useDefaultRule = true;
c.setOptions(dmlOpts);
}
}
}
***********************************************************************
Or are there any other creative solutions around this?
Here's the trigger code, but it doesn't seem to be working. Any ideas?
**********************************************************************
trigger CommunityCaseAssignment on Case (before insert) {
for (Case c: Trigger.new) {
if (c.Origin == 'Community') {
Database.DMLOptions dmlOpts = new Database.DMLOptions();
dmlOpts.assignmentRuleHeader.useDefaultRule = true;
c.setOptions(dmlOpts);
}
}
}
***********************************************************************
Or are there any other creative solutions around this?
All Answers
http://developer.force.com/cookbook/recipe/running-case-assignment-rules-from-apex
The info on that link is not all that helpful.