AnsweredAssumed Answered

/rest/v1/customobjects/{name}.json is populating empty datetime field with default value

Question asked by Yann Lair on Sep 10, 2019
Latest reply on Sep 10, 2019 by Yann Lair

Hi,

 

We are encountering a very weird behaviour with the custom object creation. It appears that when we push a new custom object with an empty datetime field (CheckoutDate), it actually gets populated with a fixed date (26/08/2019) and we have no idea why.

More details:

  • We are using the following POST endpoint  from a C# client

POST /rest/v1/customobjects/{customObjectName}.json

  • The custom object input has a data contract name "bc_logodraft_c" and looks like that in json:

{

"userEmail": "yann.lair+1@designcrowd.com",

"dateSaved": "2019-09-10T08:22:15.060624Z",

"saveCount": 1,

"checkoutDate": null,

"backgroundColor": null,

"logoColor": null,

etc.}

  • The CheckoutDate that you see in the above json gets set to the following in the Marketo customObject. How is it possible?

CheckoutDate: 26/08/2019

  • Odd things:
    • This is always the SAME date that gets saved
    • The other null fields are not filled (logoColor is still null in the custom object)
    • we only use DateTime objects, as you can see with dateSaved and this default date doesn't have the time part
    • There is no way to set a default value for a custom object field in Marketo but it behaves like it

 

We now to the point where we have to ask for your help cause we've exhausted all our ideas on the why for this one.

 

How is it possible that this custom object get created with a default date when set to null?

 

Thank you very much in advance for your help.

 

Yann Lair.

Outcomes