I try to insert an empty value for a DateTime field. This field is optional in my action.
I call this action from a Logic App, through the HTTP Post step. In my body I have valid Json including the field: (this is a part of the complete message)
{
"enddate":""
}
With all kinds of alternatives I tried, but every time I get tis error:
DateTime is less than minumum value supported by CrmDateTime. Actual value: 01/01/0001 00:00:00, Minimum value supported: 01/01/1753 00:00:00"
Sync workflow failed with error message - Exception type: System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]
Message: DateTime is less than minumum value supported by CrmDateTime. Actual value: 01/01/0001 00:00:00, Minimum value supported: 01/01/1753 00:00:00
Hi,
I guess that the problem is that DateTime is not nullable and the default value is 01/01/0001.
You can add a new field in the action to distinguish if the datefield is filled or not and consequently update the CRM entity.
So:
1. if the new filed "datepassed" is true and the field "enddate" is equal 01/01/0001 this means that in the action you have to pass "enddate" = null in the attribute collection, if "enddate" is <> 01/01/0001 you have to add "enddate" with the new datetime value
2. if the new filed "datepassed" is false you don't have to add "enddate" attribute to the collection.
It seems to be a mess but it should work... ;-)
Hi Guido,
Thanks,
I have tried :
-"enddate": ""
-"enddate": null
-"enddate": null as expression
- leave enddate out as parameter
All with the same result.
The only thing that works as a workaround is to use the Coalesce function and fill the date with a value of 1753-01-01 and use a post-action to clear this date. But I think that's a very dirty way of working.
try to write null instead of ""
so
{
"enddate": null
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,522 Super User 2024 Season 2
Martin Dráb 228,441 Most Valuable Professional
nmaenpaa 101,148