Breaking news from around the world
Get the Bing + MSN extension
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, PowerApps, Microsoft Flow, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates to Dynamics 365Release overview guides and videos Release Plan | Early Access Availability
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Talent TechTalks | Upcoming TechTalks
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<object>)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));
Did you check if the contact and opportunities are being created when you qualify lead? The code looks correct.
Hi Ravi, yes all the 3 records are being created. But when debugged only the first if conditions for account is returning true while remaining two if conditions are returning false.
I had to use retrieve parentaccountid and parentcontactid fields on lead post async of QualifyLead and then use account information to retrieve latest opportunity. My approach works but not satisfied as I didnt have to do this work around where a straight approach would save few lines of code.
I agree, we shouldn't need to use a workaround for the functionality which should be available out of box. It could be a bug also. You could raise a support case with Microsoft to confirm this behavior.
Business Applications communities