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
NicNic 

how to apply leads assignment rules

Is there anyway to active the assignment rules for the leads?

I have no problem to insert leads by using the tool kits, but all the leads have been stay into the login account instead of being distributed. Is there any way I can do via the API?

 

VinnieBVinnieB

I've got a similar issue with cases created via sforce.  I'd at least like an email to go out to a specific email address once a case has been created.  I guess I could do this from the page itself but I'd prefer to do it via SalesForce.

THANKS!!

benjasikbenjasik
In the 2.5 Soap API, you should be able to specify SaveOptions on the SforceService. Create a new SaveOptions object, set autoAssign=true and then specify the assignmentRuleId.

This is also possible via xml/rpc. Which API are you trying to do this from?
NicNic
How to do it with xml/rpc? I am using 2.0 API. Thanks.
DevAngelDevAngel

Hi Nic,

You should add to additional parameters to the update or insert call.  The first is a boolean called autoAssign.  You should set this to true.  The second is a string called assignmentRuleId and should contain the id of the assignment rule you wish to use.

NicNic

Thanks Dave,

I am trying to add them as fields in my MapEntry[] records. But given a error "bad field names on insert/update call: autoAssign, assignmentRuleId". I felt that I am not putting in the right place. Where exactly shall I add them?

My insert call is like this:  value = (org.w3c.dom.Element)binding.insert("lead", record);

 

DevAngelDevAngel

Hi Nic,

It's a little confusing, they go up a level from the mapentry

My insert call is like this:  value = (org.w3c.dom.Element)binding.insert("lead", record, true, "0030000003dj44s");

I think you are using soap, right?  If so, you will need to change the binding.insert.  One way is to modify the wsdl to include the 2 parameters correctly and then re-run WSDL2Java to re-create the stubs.  The other would be to directly modify the stubs.

The wsdl modification is shown below, I added the red lines.

  <message name="insert">
    <part name="type" type="s:string" />
    <part name="record" type="s0:map" />
    <part name="autoAssign" type="s:boolean" />
    <part name="assignmentRuleId" type="s:string" />
  </message>
  <message name="update">
    <part name="type" type="s:string" />
    <part name="record" type="s0:map" />
    <part name="autoAssign" type="s:boolean" />
    <part name="assignmentRuleId" type="s:string" />
  </message>