1

Essentially, we have business records coming in with company names, but we'd like the lead assignment rules to ignore prefixes such as "The" or "A", etc. Formula fields have been tried, but it seems the assignment fires before the formula calculation.

What would be the best way to accomplish this?

3
  • Are you assigning based on the results of the formula, or using a workflow rule?
    – sfdcfox
    Mar 31, 2017 at 17:26
  • Are you assigning the Lead based on Company name? Mar 31, 2017 at 17:37
  • lead assignment rules can exploit formula fields as they are always calculated on demand. You should expose some sample lead assignment rules by using edit on your question
    – cropredy
    Apr 3, 2017 at 5:36

1 Answer 1

0

You could use before trigger on Lead object, and replace whatever prefix is to be ignored. As per the salesforce documentation, before trigger fire before assignment rules, so you should be good.

Sample Code

trigger LeadTrg on Lead (before Insert) {
   for (Lead ld: trigger.new)
   {
       if (ld.Company.contains(<ignored string>)
            ld.Company = ld.Company.replace(<ignored string>, '');
   }
}

Above code is create on-the-fly and not tested.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .