I have a lead record which was created from web and assigned with proper queue based on its country in address. Incase same record is updated by its country field in web, record is updating correctly. but queue is not changing based on its new country value . So we are selecting Assignment rule check box manually every time on those records who are get updated in web. please guide me why manually check box selection is only assigning queues to web to lead records?
1 Answer
Lead assignment rules do not happen automatically when a Lead is inserted/updated (via Apex DML or API call)
So, since your Leads are coming from some Web Server, each API call that inserts or updates Leads needs to set the AssignmentRuleHeader
From the Soap Doc:
AssignmentRuleHeader
The AssignmentRuleHeader must be specified in the create() or update() call of a Case or Lead for the specified assignment rule to be applied, and it must be specified in the update() call of an Account for the territory assignment rules to be applied.
From the REST doc
Assignment Rule Header
The Assignment Rule header is a request header applied when creating or updating Cases or Leads. If enabled, the active assignment rules are used. If disabled, the active assignment rules are not applied. If a valid AssignmentRule ID is provided, the AssignmentRule is applied. If the header is not provided with a request, REST API defaults to using the active assignment rules.