0
votes

I am extending some CRM callouts to add extra functionality, I have been told not to rewrite them as plugins for compatibility reasons. In a postupdate on the lead entity I want to carry out some extra actions if a certain attribute on the lead entity has changed. My callout is corectly registered and triggers after a lead is updated and runs the overidden method with the below sig

public override void PostUpdate(CalloutUserContext userContext, CalloutEntityContext entityContext, string preImageEntityXml, string postImageEntityXml)
{
}

From what i understand i can deserialise preImageEntityXml and postImageEntityXml into DynamicEntity objects so that I can work out what has changed. However preImageEntityXml and postImageEntityXml are both null and i can't work out why.

1

1 Answers

2
votes

It is really a shame that you cannot rewrite the callouts as plugins. Plugins would work perfectly here because you can register your steps to only fire if specific attributes have changed. That way your plugin is not running on every update of the specified entity (like a callout would).

Although it has been a while since I wrote a 3.0 callout, I remember there being a callout.config file where you would specify pre and postvalues that you wanted passed along with your callout. Perhaps there are no pre and post values registered for the callout?

<callout entity="lead" event="PostUpdate">
 <subscription...>
  <prevalue>...
  ...
  <postvalue>...