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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How can i monitor record status changes?

(0) ShareShare
ReportReport
Posted on by

Hi  all,

I am using Dynamics 365 online v9.  I find that the workflow could be triggered by "record status changes"

_0B770B770B770B77_.png

however, the workflow is only for one entity.  So I want to write a plugin and apply it on all entity.  When it's status changes, the plugin will trigger and do something. 

but how can I monitor this event?  can someone help this?    I want my plugin could be triggered like the above workflow.

Thanks 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Josh Auton Profile Picture
    on at

    Since a workflow is Entity specific I don't believe there is a way to do it in a single workflow.  As far a plugins go you could write a plugin and then just add a step for each entity that you will need to monitor and then just run the one plugin.  As long as you don't need to access anything unique to an entity (everything except common entity common fields i.e. statecode, satuscode, createdon …) this should work.

  • Community Member Profile Picture
    on at

    hi,   can you make it clear?  how can i  add step?

    _4C704C704C704C70_.png

    and in my code, how can i know the trigger is correct?

  • Suggested answer
    Josh J A Profile Picture
    50 on at

    You will need to set the "Message" to "Update" and the "Primary Entity" to the Entity you need this to fire on, for the Filtering Attributes add the StatusCode field and remove all others.  You will add one of these steps for every entity you need to monitor the status change.  So lets say I need to run the exact same code for the Account, Contact, and Order.  I would have 3 steps and if I need a pre-image or a post-image I would add it to every step (since it is entity dependent and step dependent).  As far as in your code you can look at the "target" and it will tell you what fields have changed but best practice is to set the filtering attributes so that it only fires on those fields changing.  Message me if you would like help with it.

  • Suggested answer
    Kokulan Profile Picture
    18,054 on at

    Hi

    If you enable auditing at the Global level and entity level, CRM will audit all the changes and you can check how the status changed for an entity.

    I would recommend you look into CRM auditing feature as it does it efficiently and it happens at the platform database transaction level.

    Please follow the links below to know more about how you can enable and use auditing to monitor status changes

    https://crmbook.powerobjects.com/basics/data-management-in-microsoft-dynamics-crm/auditing-in-microsoft-dynamics-crm/

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/auditing-overview

    Note: CRM auditing has improved a lot, you can even audit user access  if the user views a record

  • Community Member Profile Picture
    on at

    i  want to apply it on all entities.  and i see there are  "setstate"/"setstatedynamicentity"  message.  which one should i set?

  • gdas Profile Picture
    50,091 Moderator on at

    Hi ,

    "setstate"/"setstatedynamicentity"  message has been deprecated , You should use update instead of  setstatedynamic/setstate.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans