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)

Crm to Azure ServiceBus Event Receiver, cant find what property that has been updated

(0) ShareShare
ReportReport
Posted on by

This is a compact version, please ask if you need clarifications:

I have managed to register an endpoint so that when I update a property (for example phone number) in Dynamics CRM Online a message is sent to Azure Service Bus (topic and/or queue, no difference here). I also have a webjob that listens to theses changes, using the signature below:

public static void ProcessTopicMessage([ServiceBusTrigger("my-crm-topic", "topic-subscription1" )] BrokeredMessage pQueueItem, TextWriter log)
{
   RemoteExecutionContext package = pQueueItem.GetBody<RemoteExecutionContext>();

   if(package.MessageName == "Update")
   {
      Entity entity = pPackage.InputParameters["Target"] as Entity;            
      var newPhone = entity.GetAttributeValue<string("telephone1");    

   }

...

}

This works ok, when I change for example phone number I can read the new phone number and all other properties are null. HOWEVER, I cant find any information on the name/id of the property/properties that were changed (except that they are not null).

I could loop through all property names and be happy with that, but the main problem is that there no way to know if the property was set back to null from something else.

I cannot find any indication of that its the phone number that has been changed in pQueueItem- or package-properties. Where do I find it?


   

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Georgy Profile Picture
    on at

    Hi,

    in your "target" entity, (Entity entity = pPackage.InputParameters["Target"] as Entity)

    you have collection of attributes. Those are the only attributes that were changed (either set to null or initialized with some value). Looping through this collection would provide you with what you need.

  • Community Member Profile Picture
    on at

    You are my hero :), I didnt check there, just indexed with property names that I knew of. As you pointed out, the Attributes-array contains the updated property/ies, along with four properties that always are there. Thanks a bunch!

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