Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 154803

Forum Post: RE: Updating a lookup in a custom entity through plugin

$
0
0
yeah, i tried debugging it but i am getting some serialization format issues on debugging.So, i simply used traces in my code and directly run it.. Yes, here is the code below: try { // The InputParameters collection contains all the data passed // in the message request. if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity) { // Obtain the target entity from the Input Parameters. tracingService.Trace("Target entity is wineorder"); Entity entity = (Entity)context.InputParameters["Target"]; tracingService.Trace(entity.LogicalName); if (entity.LogicalName != "new_wineorder") return; if (entity.Attributes.Contains("new_customer")) { tracingService.Trace((entity.Attributes["new_customer"]).ToString()); } EntityReference customerId = (EntityReference)(entity.Attributes["new_customer"]); tracingService.Trace(customerId.Name); Entity contactCRM = RetrieveEntityById(service, "contact", customerId.Id); string v360id = contactCRM.Attributes["pager"].ToString(); // I got the trace till the line : if (entity.Attributes.Contains("new_customer")) { tracingService.Trace((entity.Attributes["new_customer"]).ToString()); }

Viewing all articles
Browse latest Browse all 154803

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>