You need to sign in to do that
Don't have an account?
Assignment rule not fire in case controller extension
I have created custom case page overriding standard functionality through controller extension
and I want to fire assignment rule conditionally
my code is here
**************************************************
public class caseextension
{
private Case case1;
public boolean assrulevalue;
public caseextension(ApexPages.StandardController stdController)
{
this.case1= (Case)stdController.getRecord();
}
public PageReference save()
{
AssignmentRule assgn=[Select Name, Id From AssignmentRule where name='Testassign'];
string id=assgn.id;
if(assrulevalue==true)
{
database.DMLOptions dmo = new database.DMLOptions();
dmo.AssignmentRuleHeader.assignmentRuleId=id;
dmo.AssignmentRuleHeader.useDefaultRule= false;
case1.setOptions(dmo);
//mailerror('testing');
}
//mailerror('testing'+id);
insert case1;
//database.insert(case1, dmo);
PageReference pageRef = new PageReference('/' + case1.id);
pageRef.setRedirect(true);
return pageRef;
}
public boolean getassrule()
{
return assrulevalue;
}
public void setassrule(boolean value)
{
assrulevalue=value;
}
**********************************************************
So what wrong with this code.
All Answers
I am also having same issue. I have built a visualforce Case page based on custom controller and not able make auto assignment work using dmloptions.
This Case page is exposed to customer portal users.
any ETA on when this would be fixed ? any workarounds ? e.g. set a "Assign using active assignment rules" field to true before upserting a case ?
Hi there,
By When Salesforce Development Team is expected to fix this problem?
Any insight will be helpful to know and set expectations with my team & customer.
Thank you,
/Vikas Arora
I guess that's a bit of a relief because I've been going mad with this. Is there anywhere where Salesforce.com have officially acknowledged this in writing where us regular folk can see? SFDC have a way of taking their sweet time on these sorts of bugs.
Message boards to the rescue! (well, sort of).
I was also trying to debug this same issue with some very similar code of my own until I got it in my head to go search on DMLOptions and I found this. tmatthiesen, can you update this board when the bug is fixed? Thx.
I was told that this was scheduled to be fixed last Friday. It seems to be fixed, but while my assignment rules are assigning properly, they're not sending out the assignment emails.
Maybe it's fixed but only partially?? Anyone else tried this lately and received assignment emails?
I'd put on dmo.EmailHeader.triggerAutoResponseEmail = true;
Not quite the same thing!
string id =[Select Name, Id From AssignmentRule where name='Lead Assignment'].id; database.DMLOptions dmo = new database.DMLOptions(); dmo.AssignmentRuleHeader.assignmentRuleId=id; dmo.AssignmentRuleHeader.useDefaultRule= false; dmo.EmailHeader.triggerUserEmail = true; dmo.EmailHeader.triggerAutoResponseEmail = true; NewLead.setOptions(dmo); insert NewLead;
My issue can be found here - i'm trying to use DMLOptions in a trigger:
http://community.salesforce.com/sforce/board/message?board.id=apex&message.id=15118