Monday, May 18, 2015

Lead not able to qualify in Microsoft Dynamics CRM

Error during Lead qualification process

Hi,
sometimes it can happen, that you do some incorrect customization, although you have only the best intentions.
If you play around with the Lead qualification, opportunities, contacts and account you may want to modify also connection roles.
But, please be aware!!!!

If you (during the qualification of a Lead) start receiving error like this (valid for CRM 2013, CRM 2015 and CRM OnLine):

Error code is: 2147159520

Message: "An error has occurred. Either the data does not exist or you do not have sufficient privileges to view the data. Contact your system administrator for help."

And in the trace log, you will get something like this:

Crm Exception: Message: An error has occurred. Either the data does not exist or you do not have sufficient privileges to view the data. Contact your system administrator for help., ErrorCode: -2147159520, InnerException: Microsoft.Crm.CrmException: An error has occurred. Either the data does not exist or you do not have sufficient privileges to view the data. Contact your system administrator for help.
   at Microsoft.Crm.ObjectModel.ConnectionService.ValidateConnectionRoleObjectType(IBusinessEntity entityConsolidatedValues, IBusinessEntity entitySuppliedValues, ExecutionContext context)
   at Microsoft.Crm.ObjectModel.ConnectionService.Validate(IBusinessEntity entityConsolidatedValues, IBusinessEntity entitySuppliedValues, ExecutionContext context)
   at Microsoft.Crm.ObjectModel.ConnectionService.Create(IBusinessEntity entity, ExecutionContext context)
   at Microsoft.Crm.ObjectModel.LeadService.CreateLeadParentContactConnectionIfNotExist(IBusinessEntity entity, ExecutionContext context, BusinessEntityCollection connections, BusinessProcessObject bpo)
   at Microsoft.Crm.ObjectModel.LeadService.AddContactAsStakeholder(IBusinessEntity entity, ExecutionContext context)
   at Microsoft.Crm.ObjectModel.LeadService.Update(IBusinessEntity entity, ExecutionContext context)
   at Microsoft.Crm.ObjectModel.LeadService.QualifyLead(BusinessEntityMoniker leadId, Boolean createAccount, Boolean createContact, Boolean createOpportunity, BusinessEntityMoniker opportunityCurrencyId, BusinessEntityMoniker opportunityCustomerId, BusinessEntityMoniker sourceCampaignId, Int32 statusCode, ExecutionContext context)


Then you have most likely deleted the connection role "Stakeholder" from your CRM system.

So the truth is, that when you qualify the Lead, a new Contact and a new Opportunity is created and also connections between these new records are created. The new connection records use a stakeholder role. If this role has been deleted, then the qualification process fails.

Here is the picture how it looks like:

Connection roles


After you qualify the lead, there are 4 new connection records in the connection database:

  • Lead > Contact
  • Contact > Lead
  • Opportunity > Contact
  • Contact > Opportunity

Each of these records contain reference to the Stakeholder role.

The enlightenment from this is: Do NOT delete system Connection roles!!!


I hope this will save you time when you get error like this.
Michal

2 comments:

  1. IF the stakeholder roles was deleted, what is the fix? I created a new connection role of named stakeholder and set everything the way it should be and still get the error.

    ReplyDelete
  2. IF the stakeholder roles was deleted, what is the fix? I created a new connection role of named stakeholder and set everything the way it should be and still get the error.

    ReplyDelete