web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Not able to update a locked field by plugin after v9 upgrade

(0) ShareShare
ReportReport
Posted on by

In v8.2, I had a pre-op plugin that would update a few of of the locked fields on the quote entity (freight, tax, for example). Once we upgraded to version 9, those fields no longer update. The plugin doesn't throw any exceptions, and if I point the plugin to custom temp fields, it shows the calculations that the plugin is doing is in fact happening, it just can't update those locked fields anymore. Is there anything I can do about this?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    This can't be true as locking of the fields happens on client side whereas plugin runs on server side. Do you have any check/ condition which update the field? If the plugin is triggering then it will update the field irrespective if those are locked

    Are you making these field locked by business rule? If yes, does this business rule have scope as "Entity". If yes then this could be something which is changed in v9 and causing plugin to not update the locked fields.

    Hope this helps.

  • Community Member Profile Picture
    on at

    Thanks Ravi - I checked all the biz rules, nothing setting those fields required. Nor any js is setting them.

  • RaviKashyap Profile Picture
    55,410 Moderator on at

    Can you share the plugin code if possible? Did you check if the plugin is even getting triggered?

  • Community Member Profile Picture
    on at

    The plugin is getting triggered, I'm writing out a debug line after most of the code lines, and I have a test harness to let me step through the code. It steps on the lines that set the values of the entity, and exits without error. In fact, just found there is a separate plugin that tries to update the OOB freight field that is behaving the same way.

  • Suggested answer
    Ben Thompson Profile Picture
    6,350 on at

    I think we've seen this before and it's due to something else in the chain of plugins that results in those fields being recalculated again some time after you set the values in the pre-op stage. I also remember a previous example which was not quite the same where the quote was being recalculated as a quote line was added (this was especially true where a quote was being re-created).

    It's also worth remembering that how various items work was significantly changed between 8.2 and 9.0. Many things that were done within the system itself in 8.2 are now done via plugins in 9.0

    While I know it's not an ideal solution my advice would be to see if you can move the plugin into post-operation mode so that you can be sure nothing is trying to override your request.

  • David Jennaway Profile Picture
    14,065 on at

    If you enable auditing, this may help understand what is happening, especially whether your changes are being overwritten. The system changes should be recorded, though note that some of them may show as updates via a Read operation (this is just how the internal processes work)

  • Community Member Profile Picture
    on at

    Thanks David - audit does in fact show that. My plugin updates the record, CRM flips it back to a default value. I changed to a post op plugin, and it still happens.

  • Ben Thompson Profile Picture
    6,350 on at

    Is the plugin just running on Create requests or on Update as well? Are any quote lines being created alongside the Quote itself?

  • Community Member Profile Picture
    on at

    Just update, not create. There are quote lines as part of the quote. The tax field does update if I turn off system pricing calculations; but that means all calculations, and we're not currently custom calculating any others. In 8.2, that setting is turned on as well, but it works fine there.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans