Personalized Community is here!
Quickly customize your community to find the content you seek.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 Release Wave 2Discover the latest updates and new features to Dynamics 365 planned through March 2021.
Release overview guides and videos Release Plan | Preview 2020 Release Wave 2 TimelineWatch the 2020 Release Wave 1 virtual launch event
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 | Upcoming TechTalks
I am trying to do some custom things when a Lead is being created by Email activity. I am using as is Convert To button, i registered a plugin in Lead Create Message, when i check the attributes of the Target i can't see any attribute about this record is being created by E-mail Convert to. Which attribute should i check? My plugin is in PreOutsideTransaction
The only idea that I have in mind is to check "ParentContext" for some additional information. If it doesn't contain it - I'm afraid it will be really hard to define the origin of the lead creation.
you can check the parent context like the following:
public void Execute(IServiceProvider serviceProvider)
// Obtain the execution context from the service provider.
IPluginExecutionContext context = (IPluginExecutionContext)
ITracingService tracingService =
// Obtain the organization service reference.
IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));
IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId);
if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)
Entity entity = (Entity)context.InputParameters["Target"];
if (entity.LogicalName == "lead")
Entity lead = entity;
if (context.ParentContext.ParentContext != null && context.ParentContext.ParentContext.PrimaryEntityName == "activitypointer")
tracingService.Trace("The lead was created by " + context.ParentContext.ParentContext.InputParameters["ActivityEntityName"].ToString());
Enabling the plugin trace in your org you can see that if you use Convert To inside Email, you will have something like:
When Lead gets created from Email, Email regarding field will be set to newly created lead. So you can check if newly created lead has any existing Email associated based on regarding. This way you will come to know that lead has created from Email using convert to ribbon button.
I found that ParentContext.MessageName is Convert Activity. So this resolves my problem. Thanks
This is works too thanks
Unfortunately, in the Unified Interface this convert to lead works different and it is giving parent context null. It is fine when not using unified interface. Aynone got idea why same process giving parent context null in Unified Interface...
I played a bit and unfortunately I see the same result also I have no other ideas unfortunately.
Hello, i tried your suggestion but unfortunately when this process is happening on Unified Interface, the regarding field does not set. It stays empty. Again working different from usual. Do you know if i can plug in this process and do this step manually?
Business Applications communities