Check out the latest features available in Dynamics 365 for Customer Engagement, including LinkedIn Connect, Voice of the Customer and Universal Resource Scheduling.
Dynamics 365 2019 release wave 2 plan Discover the latest updates to Dynamics 365.Release Plan | Weekly Deployment Notes
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 and Operations TechTalks | Customer Engagement TechTalks | Talent TechTalks
I have written a plugin on "Post Operation" of salesorderdetail and the message is "Create". And in this plugin I am trying to update my custom field on salesorderdetail entity to some value.
Note: Both the entities "salesorderdetail" and "quotedetail" are having this custom field and created the mapping of these custom field.
After clicking on "create order" button on quote form, I want the custom field should get updated with my value and plugin should fire but it's not updating the field.
Please let me know if the scenario is not clear.
Any help will be appreciated!
Thanks in advance!
Could you please share your code ?
if (context.InputParameters["Target"] is Entity targetEntity)
if (context.Depth > 1)
var configurationResponse = SomeExternalAPi(passingvaluefromof "somecustomfield");
targetEntity.Attributes["customfield"] = configurationResponse.Content.Id.ToString();
targetEntity.Attributes["customfield"] = Guid.Empty.ToString();
From your code there is a condition if (context.Depth > 1) then do the changes. I wonder if this isn't your issues, as if you are not within a loop the depth should always be 1
Can you change that condition from if (context.Depth > 1) to if (!context.Depth > 1) and see if then your record gets updated?
If you still see the issue, then I would also implement the tracing service and log messages for debug or use the plugin profiler
Hi Radu Chiribelea, I have checked the depth and it's coming as 2 but still I have put my code in (!context.Depth > 1) block as you said, it's by passing.
Please note that I have registered my plugin at: Pipeline stage - Post Operation, Message - Create, Execution mode - Synchronous.
Can you try to enable tracing
Or use the plugin profiler community.dynamics.com/.../how-to-debug-plugins-using-profiler
This might help you narrow down
Business Applications communities