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()); }
↧