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
Anand SinghAnand Singh 

S-Control: While creating Case, How to set AssignmentRuleId in AssignmentRuleHeader?

Hi,
 
S-control is used to create Case record.
Requirement: need to assign case record using active Assignment rule.
 
How can I specify the assignmentRule Id in AssignmentRule header of sforce object?
 
Api Details: 11.1
 
~~~~~~~~~~~~~~~~~~~~~
Following code doesnot work:

sforce.connection.AssignmentRuleHeader.useDefaultRule = true;
sforce.connection.AssignmentRuleHeader.useDefaultRule = 'true';
sforce.connection.AssignmentRuleHeader.useDefaultRule = "true";

sforce.connection.AssignmentRuleHeader.assignmentRuleId ='09W70000000AeeU';
sforce.connection.AssignmentRuleHeader.assignmentRuleId ="09W70000000AeeU";
sforce.connection.assignmentRuleId ="09W70000000AeeU";

Need help on this.

Thanks in advance,
Anand



Message Edited by Anand Singh on 03-20-2008 06:13 PM

Message Edited by Anand Singh on 03-24-2008 11:44 AM
Best Answer chosen by Admin (Salesforce Developers) 
Anand SinghAnand Singh

At last I found the solution which works perfectly fine  (sorry for delay in posting):

 

var NewCase = new sforce.SObject("Case" );  
NewCase.Id = NewCaseId;
sforce.connection.sessionId = "{!$Api.Session_ID}";
sforce.connection.assignmentRuleHeader = {useDefaultRule:true}; 
var saveResult = sforce.connection.update([NewCase]);

Message Edited by Anand Singh on 01-28-2010 09:24 PM

All Answers

Sandeep001Sandeep001
try this :- 'a' should be in small case.

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


or try this:


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


Let me know if any other 'hit n trial' stuff worked for you.
Anand SinghAnand Singh

Thanks Sandeep,

Let me give a trial and will let you know.

Sandeep001Sandeep001
use this...it wil definitely work:-

sforce.connection.emailHeader = {triggerUserEmail:true, triggerAutoResponseEmail:true};
Anand SinghAnand Singh

At last I found the solution which works perfectly fine  (sorry for delay in posting):

 

var NewCase = new sforce.SObject("Case" );  
NewCase.Id = NewCaseId;
sforce.connection.sessionId = "{!$Api.Session_ID}";
sforce.connection.assignmentRuleHeader = {useDefaultRule:true}; 
var saveResult = sforce.connection.update([NewCase]);

Message Edited by Anand Singh on 01-28-2010 09:24 PM
This was selected as the best answer