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
keystonekeystone 

How to trigger Lead Assignment Rule using Enterprise WSDL with Java API?

Using the Java and the enterprise WSDL I'm trying to add Leads and trigger the associated  Lead Assignment Rule.  I have no problem submitting the Lead object but the lead rule is not triggered for some reason.

 

I am setting the Assignment Rule Header on the Connection and I have tried these two options:

1. Using null for the assignment rule id and setting useDefaultRule to true.

2. Query for the actual assignment rule id and setting that rule id and setting useDefaultRule to false.

 

However in both cases the rule is not triggered in Salesforce.  Does anyone have any ideas what might be wrong/missing?

 

My Java code does the following:

1. Create/login to the connection.

2. Call setAssignmentRuleHeader() on the connection.

3. Call create passing the array of Lead objects (w/ size of one).

4. Logout of connection.

 

Does anyone have any examples of java code that successfuly triggers rules?

 

Thanks,

-Dave

keystonekeystone

I've received better clarfication on this issue.  It turns out the lead is assigned following the rules but an email is not sent to the person who was assigned the lead as the rules state.  What could cause the email to not be triggered?

SuperfellSuperfell

You need to set the EmailHeader to control if the emails are sent.