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,...
Unanswered

RemoteExecutionContext - CRM 365 to service bus - deserialising with json.net or DataContractJsonSerializer date format in json string

(1) ShareShare
ReportReport
Posted on by

My scenario is that I reading messages off a service bus that a plugin or OOB connector from CRM 365 adds a json object to a service bus.

Using this approach I see that datetimes are in json:
community.dynamics.com/.../parse-json-string-that-represents-the-dynamics-365-plugin-execution-context-received-in-azure-function

Trying to use json.net to deserialize the message I encounter an issue:

Newtonsoft.Json.JsonSerializationException: 'Cannot create and populate list type Microsoft.Xrm.Sdk.KeyAttributeCollection. Path 'OwningExtension.KeyAttributes', line 1, position 7017.'

So instead I have resorted to using DataContractJsonSerializer. With this I have an issue with dates when trying to map to an entity and early bound classes.

The service bus message is of type RemoteExecutionContext - but when I deserialize this message the date formats are in the following:

"key": "createdon",
"value": "/Date(1633688867000)/"


I would like it in the DateTime format before converting to an account model for instance otherwise dates will not work correctly and the mapping will fail.

Any ideas on how to solve this would be appreciated.

I have the same question (0)

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 137 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 57

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans