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 :
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,373 Most Valuable Professional on at

    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
     @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…

Neeraj Kumar – Community Spotlight

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

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 74 Super User 2025 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 31 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans