2 February 2019 • 3 minutes
This post describes an odd behavior of the Potential Customer Opportunity field that I recently ran across. I couldn’t find this documented anywhere else, so I wanted to share. Everything was tested on Dynamics CRM Online 9.0.1.1121.
The Potential Customer field works differently depending on how an opportunity is created. If you manually click the New button or qualify a lead to an opportunity, the Potential Customer field will contain the associated account (so long as that field is populated). However, if you create a new opportunity from an existing Contact record, the Potential Customer will be the Contact, even when an Account has been specified.
Normally, when you create an opportunity, the Potential Customer is populated like so:
Account (parentaccountid) | Contact (parentcontactid) | Potential Customer (customerid) |
---|---|---|
Not Null | Null | Account |
Null | Not Null | Contact |
Not Null | Not Null | Account |
The account value is the primary value mapped to Potential Customer and it will always be mapped so long as it is not null, regardless of whether it was set at creation time or later on.
When creating an opportunity from an existing Contact, the Potential Customer field is always mapped to the Contact on creation of the Opportunity.
Account (parentaccountid) | Contact (parentcontactid) | Potential Customer (customerid) |
---|---|---|
Null | Not Null | Contact |
Not Null | Not Null | Contact |
Here’s what this looks like in action:
Click the + button on the related opportunities grid to add a new opportunity.
Fill out the required fields and click Save.
Navigate to the Opportunities List (Sales > Opportunities) and notice that the Potential Customer lists the Contact name, not the Account name.
As I mentioned earlier, I could find no mention of this behavior anywhere online or in Microsoft’s documentation. I’m unsure if this is the expected behavior or if this is a bug, but I can say this caught me a little off guard since it differs from how the field works in other instances.
A fix is relatively straightforward, because we always want the Potential Customer to reference the associated account.
The end result ends up looking like this:
The nice thing about this solution is that it gives us the behavior we’re looking for when a new opportunity is created and the default behavior of the account field on the opportunity, described above, will take care of populating the Potential Customer field if the account changes in the future.