Hi Guys
I'm trying to update some fields on Account, Contact and Opportunity that are created by qualifying a lead. Using below code to achieve it but the only record that is being retrieved is account. Contact and Opportunity are not being retrieved.
EntityReference entity = (EntityReference)context.InputParameters["LeadId"]; Entity lead = service.Retrieve("lead", entity.Id, new ColumnSet(true)); foreach (EntityReference created in (IEnumerable)context.OutputParameters["CreatedEntities"]) { if (created.LogicalName == "account") { Entity account = service.Retrieve("account", created.Id, new ColumnSet(true)); } if (created.LogicalName == "contact") { Entity contact = service.Retrieve("contact", created.Id, new ColumnSet(true)); } if (created.LogicalName == "opportunity") { Entity opportunity = service.Retrieve("opportunity", created.Id, new ColumnSet(true)); }