Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Strange Issue With Plugin Not Updating Values Except When Debugging

Posted on by 125

I have a weird issue where a value updated by a Plugin only seems to get updated when the debugger is on. Below is the code. 

Opportunity gl_opp = new Opportunity();

gl_opp.Id = opportunity.Id;
gl_opp.gl_IntroductionOfferTotalDiscount = new Money(introTotal);
gl_opp.gl_PCODiscountVariance = new Money(floorVariance);
gl_opp.gl_PCOTargetVariance = new Money(targetVariance);

service.Update(gl_opp);

The value that is not being set is gl_opp.gl_IntroductionOfferTotalDiscount = new Money(introTotal);

However if I profile the plugin and run the profile through VS debug I can see that a value is being set for the attribute and when it goes through the debugger it actually saves the values in Dynamics. 

Anyone know what might be causing this?

 

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Strange Issue With Plugin Not Updating Values Except When Debugging

    Hi,

    Can you remove profiler if it is installed on your crm instance.

    Also, Enable trace log and see if any error is getting logged. This is sync or async plugin?

    All other fields value are getting saved in normal execution?

    Check if gl_opp.gl_IntroductionOfferTotalDiscount = new Money(introTotal); is getting changed from any other plugin/custom code.

    Enable audit history for this  field and Check auditing log.

    If found helpful, Please mark my answer verified.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans