locked
Change opportunity customer lookup to Contact on conversion of Lead. RRS feed

  • Question

  • Hi,

    When we convert a Lead to Account, Contact and Opportunity the default customer value on Opportunity is Account whereas our requirement is that the default customer should be Contact. How can we make this change.

    Regards

    Tuesday, July 27, 2010 4:02 PM

Answers

  • You could establish a Workflow that triggers on the creation of a new Opportunity.  The Workflow would need the following conditions/actions:

    Check Condition 1: Check the Originating Lead field for a value; if it has a value, then the Opportunity was created from the conversion of a Lead

      Check Condition 2:  Check that the Customer field currently holds an Account.  This can be done by selecting the "Customer (Account)" relationship as the entity, and that the "Account" attribute "Contains Data"

        Action:  Set the Customer field's value to the dynamic value:  Primary Contact of the currently specified Customer (Account).

     

    This will, however, work asynchronously and therefore the changes may not appear if you elect to display the new records after they've been created.  If you require a more synchronous operation, then you can effectively duplicate the logic above in a Plug-in which executes on the "Create" message of the Opportunity entity.  Alternatively, you could use Javascript to perform the same action; however it would be difficult to distinguish whether or not the Opportunity had just been created, and therefore may serve (to your benefit or detriment) as a constant validator of the type of record held in the Customer field.


    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    • Proposed as answer by HIMBAPModerator Wednesday, July 28, 2010 6:58 AM
    • Marked as answer by Faisal Fiaz Wednesday, July 28, 2010 11:02 AM
    Tuesday, July 27, 2010 5:58 PM
    Moderator

All replies

  • You could establish a Workflow that triggers on the creation of a new Opportunity.  The Workflow would need the following conditions/actions:

    Check Condition 1: Check the Originating Lead field for a value; if it has a value, then the Opportunity was created from the conversion of a Lead

      Check Condition 2:  Check that the Customer field currently holds an Account.  This can be done by selecting the "Customer (Account)" relationship as the entity, and that the "Account" attribute "Contains Data"

        Action:  Set the Customer field's value to the dynamic value:  Primary Contact of the currently specified Customer (Account).

     

    This will, however, work asynchronously and therefore the changes may not appear if you elect to display the new records after they've been created.  If you require a more synchronous operation, then you can effectively duplicate the logic above in a Plug-in which executes on the "Create" message of the Opportunity entity.  Alternatively, you could use Javascript to perform the same action; however it would be difficult to distinguish whether or not the Opportunity had just been created, and therefore may serve (to your benefit or detriment) as a constant validator of the type of record held in the Customer field.


    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    • Proposed as answer by HIMBAPModerator Wednesday, July 28, 2010 6:58 AM
    • Marked as answer by Faisal Fiaz Wednesday, July 28, 2010 11:02 AM
    Tuesday, July 27, 2010 5:58 PM
    Moderator
  • Thank you David.
    Wednesday, July 28, 2010 11:03 AM