Personalized Community is here!
Quickly customize your community to find the content you seek.
Have questions on moving to the cloud? Visit the Dynamics 365 Migration Community today! Microsoft’s extensive network of Dynamics AX and Dynamics CRM experts can help.
2021 Release Wave 2Discover the latest updates and new features releasing from October 2021 through March 2022.
2021 release wave 2 plan
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Community | FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Upcoming TechTalks | All TechTalks
Hello. I have been developing a C# plugin for CRM 4.0. The below code runs when a new case record is created. I have been trying to access the customer's GUID (which was added to the case record which was just created), so that I can later retrieve the customer's details such as e-mail address. I have tried two ways to do this: first by accessing the Value property using target_entity.Properties["customerid"].Value and also by trying to iterate over target_entity.Properties. However, both of these returned errors (as shown below in the code).
public void Execute(IPluginExecutionContext context)
DynamicEntity target_entity = null;
target_entity = (DynamicEntity)context.InputParameters.Properties["Target"];
/ *Below line gives following error:
'object' does not contain a definition for 'Value' and no extension method 'Value'
accepting a first argument of type 'object' could be found (are you missing a using
directive or an assembly reference?) */
String customerGuid = target_entity.Properties["customerid"].Value;
/* tried alternate way to access customer GUID value by first looping
through each property of target_entity, then accessing the Value of the customer_id
key, but get following error:
'The type or namespace name 'PropertyValueCollection' could not be found (are you
missing a using directive or an assembly reference?)'
Tried to import it with System.DirectoryServices but does not work, as
DirectoryServices is not recognised */
foreach (PropertyValueCollection value in target_entity.Properties)
if (value.PropertyName == "customerid")
String customerGuid == value.Value;
Guid customerGuid = ((Customer)target_entity.Properties["customerid"]).Value;
Business Applications communities