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

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Plugin Not Triggering when value changes from Null

(0) ShareShare
ReportReport
Posted on by 227
Hello,

I've got a plugin registered with update message of a field. Its initial value is null but when the field changes to value from null, it doesn't trigger. How can I handle a scenario like this with the update message?

 
I have the same question (0)
  • Suggested answer
    Muhammad Shahzad Shafique Profile Picture
    2,336 Most Valuable Professional on at
    Plugin Not Triggering when value changes from Null

    To handle a field change from null to a value with the update message, ensure your plugin checks for both the old and new values. The update message triggers only when the field's value changes, but a change from null to a value should still fire it.

    If it’s not triggering, explicitly check for null in your plugin logic:

    if (context.PreEntityImages["PreImage"].GetAttributeValue<Type>(fieldName) == null && 
        entity.GetAttributeValue<Type>(fieldName) != null)
    {
        // Handle the change from null to value
    }


    Alternatively, verify your plugin registration includes Pre-Image with the field and the update message is configured correctly.

  • Barış Kuzu Profile Picture
    227 on at
    Plugin Not Triggering when value changes from Null
     @Muhammad Shahzad Shafique

    Thank you for your response, I have tried to debug many times, I've come to think that it's not firing when the initial value is null. It fires after changing it from any other value. 

    Claude AI says this:

    This is a known challenge in Dynamics 365/CRM plugins.

    Why This Happens

    When you set a field to null in Dynamics:


    1. The system doesn't actually store a "null" - it removes the attribute from the entity
    2. This removal might not be recognized as an "update" to the specific field.
    3. The field might not appear in the "Target" entity at all when setting to null

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 258

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 178

#3
Tom_Gioielli Profile Picture

Tom_Gioielli 142 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans