Answered by:
Can't select Contact from unrelated Account

Question
-
Could it be possible to select primary contact on case which is not associated with the selected customer (account on case)?
When I tried to save the case I am getting error "Crm Exception: Message: The specified contact doesn't belong to the account selected as the customer. Specify a contact that belongs to the selected account, and then try again., ErrorCode: -2147157916"
Wednesday, March 11, 2015 7:41 PM
Answers
-
I think this enforcement is included in CRM 2015. In CRM 2015 we have two relationships between Case & Contact contact_as_primary_contact & contact_as_responsible_contact. First one enforces the OOB validation. In situations where we want to avoid the validation we need to use the second relationship (Responsible Contact lookup field).
- Marked as answer by potha Tuesday, March 17, 2015 4:19 PM
Tuesday, March 17, 2015 4:18 PM
All replies
-
I think CRM doesnot enforce such kind of restiction. Check for any javascript or plugin doing it
Regards Faisal
Thursday, March 12, 2015 11:12 AM -
The message and error code are in the format that Crm uses for its own errors, but the error code 8004F864 (see http://www.mscrmuk.blogspot.co.uk/2013/04/understanding-error-codes.html for how to translate the codes) is not documented in the SDK
Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk
Thursday, March 12, 2015 12:21 PMModerator -
Here is the complete exception details
I believe this is the CRM internal plugin. And i am not sure if we can override this behavior.
>Crm Exception: Message: The specified contact doesn't belong to the account selected as the customer. Specify a contact that belongs to the selected account, and then try again., ErrorCode: -2147157916
[2015-03-11 12:20:35.013] Process: w3wp |Organization:f81b30cf-7cd2-e111-b664-005056ab021d |Thread: 32 |Category: Platform.Sdk |User: 67fccd07-b56b-e311-8bb8-005056ab021d |Level: Error |ReqId: ccfbb526-0792-45ef-a800-d28d3db58876 | VersionedPluginProxyStepBase.Execute ilOffset = 0x65
>Web Service Plug-in failed in SdkMessageProcessingStepId: {8DCDBB1B-EA3E-DB11-86A7-000A3A5473E8}; EntityName: incident; Stage: 30; MessageName: Update; AssemblyName: Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin; Exception: Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values)
at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IServiceProvider serviceProvider)
at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
Inner Exception: Microsoft.Crm.CrmException: The specified contact doesn't belong to the account selected as the customer. Specify a contact that belongs to the selected account, and then try again.
at Microsoft.Crm.Service.ObjectModel.IncidentService.ValidatePrimaryContact(IBusinessEntity incident, ExecutionContext context, Boolean isUpdateIncident)
at Microsoft.Crm.Service.ObjectModel.IncidentService.Update(IBusinessEntity incident, ExecutionContext context)Thursday, March 12, 2015 4:24 PM -
Yes, you are right.
CRM enforces to select only related records. I do have faced the issue once. Downloaded the log and realized that I can't do it.
Jugal Kishore Dandamudi.
Tuesday, March 17, 2015 12:00 PM -
I think this enforcement is included in CRM 2015. In CRM 2015 we have two relationships between Case & Contact contact_as_primary_contact & contact_as_responsible_contact. First one enforces the OOB validation. In situations where we want to avoid the validation we need to use the second relationship (Responsible Contact lookup field).
- Marked as answer by potha Tuesday, March 17, 2015 4:19 PM
Tuesday, March 17, 2015 4:18 PM