Hi,
In Case, there is a field called "Customer". This field is unique, because we can choose between contact or account.
I created a plugin to move new case to inactive state, if the customer email is match with condition. Here the code:
if (entity.Attributes.Contains("customerid")) { Entity customer_detail = _service.Retrieve("contact", ((EntityReference)entity["customerid"]).Id, new ColumnSet(true)); // Code to move case to inactive. }
The problem is, when user is choose Account not contact, of course my plugin will throw an error because the contact is not found. The question is, how to check if the customer field contains account or contact ?
*This post is locked for comments