Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

What will happen to crm record.

(0) ShareShare
ReportReport
Posted on by 2

Hello All Experts,

I have a javascript code which on clicking on custom button does the functionality of changing the status of the record to inactive.

i also have one plugin which on updation of the record gets fired for all attributes.

what if run javascript code and by any reason plugin got failed .

will JavaScript be able to do it's functionality.

from my analysis it's NO but wants to confirm this.

my analysis is based on profiling the update plugin and then trying to use custom button on the form to deactivate the record. but it throws an error which is captured inside a custom error.

*This post is locked for comments

  • Verified answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: What will happen to crm record.

    All sync plugin runs under transactions , please check [View:https://msdn.microsoft.com/en-us/library/gg327941.aspx]

  • EmployeeOcta Profile Picture
    EmployeeOcta 2 on at
    RE: What will happen to crm record.

    Hello Mahender,

    Thanks for your update , but is there any article published for this for microsoft.

    it will be helpfull for me.

  • Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: What will happen to crm record.

    Sync plugin will rollback any changes that it has performed before when error occurs.

  • EmployeeOcta Profile Picture
    EmployeeOcta 2 on at
    RE: What will happen to crm record.

    Hello Aric,

    Yes Web Api is being used to change the status and update plugin in synchronous mode.

    update plugin do calculation based on some things, but it doesn't change the status.

    can you let me know this will roll back the functionality.

  • Suggested answer
    Rawish Kumar Profile Picture
    Rawish Kumar 13,756 on at
    RE: What will happen to crm record.

    hello,

    I agree - as soon as you update the status of the record , the plugin will trigger and since it is synchronous - it will stop java script too.

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 Moderator on at
    RE: What will happen to crm record.

    Hi,

    If your JavaScript code executed an Update Message on the Plugin, the Update Plugin should run.

    If you have particular functionality in your plugin code that is only for disabling, you should probably modify your plugin only to run on the change of the StateCode/StatusCode attributes.

    You can also modify your plugin to execute on the SetState/SetStateDynamicEntity messages, but those messages are probably going to go away eventually.

    Also, how are you changing the status of the record. Web Api?

    Hope this helps.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans