1

I believe my issue is best explained through an example:

I have a Lead that is being converted to an Opportunity. My Opportunity object has a custom required field that is not present in Leads because it doesn't make logical sense for it to be there. When converting the lead, the user isn't prompted for this field, and upon conversion, an Opportunity is created where the required field is blank (bad data!!!).

What's the best way to resolve this?

  • If the lead didn't have a value for the field, how will you determine the correct value for the associated Opportunity field? Perhaps you need to set a default value for this field or use a trigger/workflow to populate it on insert. – Daniel Ballinger May 21 '14 at 19:29
  • The value for the field will depend on the Opportunity. Here's a more specific example: Wile Coyote works in Acme and is present as a Lead for us. Acme functions in two industries: Making Road Runner Traps and Selling Ice Cream. When converting Wile to a Contact, we can create an Opportunity depending on whether the Opp is for the industry of Selling Ice Cream or Making Road Runner Traps. This is dependent on the Owner of the Lead/Opp/Contact/Account. I can't set a default Industry, because that will also potentially be bad data. – Dezzie May 21 '14 at 19:36
  • It sounds like you want an insert trigger that will default the field on the Opportunity based on the owner of the Lead/Opp/Contact/Account. – Daniel Ballinger May 21 '14 at 19:39
  • No, not based on the Owner. I want the Owner to manually determine what the field value should be for Industry and select it from a picklist in to the Lead Conversion screen before creating the Opportunity. – Dezzie May 21 '14 at 19:40
2

Requiredness isn't enforced because that would create scenarios where it would be impossible to convert leads. For example, the API doesn't support mapping custom opportunity values on create (i.e. you can't specify values for the new opportunity on conversion). That said, the user will be required to supply the values upon the next edit.

If you wanted to enforce rules on conversion, you could create a Visualforce page to override the conversion process. This still won't be honored for the API, but for normal UI conversions, the user could be prompted for values to supply. In the controller for the page, you can convert the lead, and then apply the new values to the newly created opportunity.

For specific details, check out the Apex Code documentation on the LeadConvert object.

  • Do you think at any point SF would consider updating the API to support the mapping? I came across this[success.salesforce.com/ideaView?id=08730000000Bra8AAC] and I was hoping that it might have something to do with what I need. Thoughts? – Dezzie May 27 '14 at 13:52
  • @DevMukherji I'm not sure. It seems more like they're interested in providing a Salesforce1-based lead conversion. – sfdcfox May 27 '14 at 16:38
1

In addition to @sfdcfox's excellent suggestion which would be a clean UI but require some development work, you can do the following as an alternative:

  • Place a soft alert on the Lead page by creating a text formula field like this that is displayed at the top of the page layout:

    IF (ISPICKVAL(Industry,""),
        IMAGE("/img/samples/flag_yellow.gif" , 'Yellow' ,12,12) & 
              'Industry must be provided before converting the Lead' & BR(),
        NULL)
    
  • Turn on the Lead Setting Enforce Validation and Triggers from Lead Convert and create a validation Rule that will prevent the Oppo from being created if some custom lead field mapped to a custom Oppo field is absent. Over time, users who see this error will self-train to pay attention to the soft alert.

Admittedly, not the same as a prompt for the Industry at time of conversion but 100% clicks-not-code

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.