You need to sign in to do that
Don't have an account?
dmays
Invoke Lead Assignment Rules
Is it possible to invoke a lead assignment rule when uploading new leads through the API? I found a posting from May 2004 which suggested the answer is "no", but I'm inquiring, hoping this has been implemented. If it is possible, could you provide a code example (.Net preferred)?
Thanks!
Thank you Scot for the info.
In case anyone's interested, here's my .Net code for invoking a Lead Assignment Rule called "Territory Assignments":
sforce.SforceService binding = ... get your login object ...
sforce.AssignmentRuleHeader arh = new sforce.AssignmentRuleHeader();
sforce.QueryResult qr = null;
binding.QueryOptionsValue = new sforce.QueryOptions();
binding.QueryOptionsValue.batchSizeSpecified = false;
try
{
qr = binding.query("select ID from AssignmentRule where Name = 'Territory Assignments' and
Ruletype = 'leadAssignment'");
if (qr.size == 0)
arh.useDefaultRule = true;
else
arh.assignmentRuleId = (qr.records[0].Id);
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
}
binding.AssignmentRuleHeaderValue = arh;
Thanks dmays... that's just the bit of code I was looking for.
Learning sForce API + .NET + Visual Studio = confused dev