2

when trying to create a lead from marketto, assignment rules are working fine but when the same lead is updated assignment rules are not applied properly, for example if we have country in the assignment rules when a lead is created it is assigned the right queue, but when we update the same lead with a different coutry lead is not assigned to right queue.

  • I'd be astonished if Marketo sends the AssignmentRuleHeader on lead updates. I had to implement (in the past) Apex trigger to force reassignment when country changed – cropredy Jun 2 '16 at 17:04
3

Normally, Lead assignment rules are triggered upon new lead, and, from the API (i.e. Marketo), Marketo must supply an AssignmentRuleHeader.

If you want to reassign leads based on an update, then, as you know, in the UI, the user must manually tick the checkbox to apply assignment rules. The same holds true for any API client, the AssignmentRuleHeader would have to be applied on updates.

But there are good reasons for an API client not to do this.

For example>

  1. New lead comes in, assigned to Foo
  2. For whatever reason, Foo reassigns to Bar
  3. Marketo updates the lead and reapplies the assignment rules. OOps - reassigned back to Foo

Marketo (or any API client) doesn't really have access to the conditionals used in the assignment rules and hence can't discriminate between changes to Lead fields that might cause reassignment versus changes to lead fields that are benign and won't cause reassignment.

Hence, the API clients like Marketo play it safe and invoke Lead assignment rules only on insert, not update

In your use case, you'll need to detect a field change and invoke a DML update on the lead with the AssignmentRuleHeader set. This can be done in an APEX trigger or Apex invocable method called by Process Builder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.