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
Holly ThompsonHolly Thompson 

Why won't my Lead Assignment Rules work on lead imports thru an API, but will work if manually created?

Originally we had the header in the API include a assignment rule ID. We want to use the functionality of useDefaultRules = True and remove the hardcoded value. But with this done, all the leads are not hitting the new active lead assignment rule and are instead going to the default owner.
I do have the page layout properties checkboxes for assignment checked. My new assignment rule is active. The assignment rules have been checked manually and they work, just not with the API sourced leads.

Do we need to hardcode the assignment rules? That is not a path I want to take. Do I have options to get this to work?
Sukanya BanekarSukanya Banekar
I am not getting whether you are importig lead using some rest API callout or through workbench or data loader or import wizard.

If you are using any data import tool then you to write trigger and use DMLOptions mentioned in the link. 

This article will help you,

Let me know if this helps.

Sukanya Banekar
Onesh ReddyOnesh Reddy

This may help you