Announcements
Hi,
I have created custom fields in LogisicsPostalAddress table. I am pushing data through Postman using Odata call.
Below is my request in postman Odata post call
{
"dataAreaId": "USRT",
"CustomerLegalEntityId": "USRT",
"CustomerAccountNumber": "1001",
“AddressStreet": "3900 Great Plains",
"AddressCity": "City1",
"AddressZipCode": "58104",
"AddressCountryRegionId": "USA",
"AddressDescription": "Address_check",
"CustomField": null
}
If I pass value null to custom fields , it is throwing error as
“An exception of type 'System.NullReferenceException' occurred in aoskernel.dll but was not handled in user code”
"internalexception": {
"message": "Object reference not set to an instance of an object.",
"type": "System.InvalidOperationException",
"stacktrace": " at Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataEntityDeserializer.ReadODataBody[T](HttpRequestMessage request)"
“
But if I pass null to standard fields as below it is not throwing any error and creating the record.
{
"dataAreaId": "USRT",
"CustomerLegalEntityId": "USRT",
"CustomerAccountNumber": "1001",
“AddressStreet": "3900 Great Plains Dr S",
"AddressCity": null,
"AddressState": null,
"AddressZipCode": "58104",
"AddressCountryRegionId": "USA",
"AddressDescription": "Address_check",
"CustomField": “Sample value”
}
Can someone please let me know what should I do so that I can pass null values to custom fields as well
Thanks
Hi Ada,
Even the custom field I created is not a mandatory field.
My question is when I create custom fields in the standard table and use it in standard data entities and pass null (not empty string) to custom field it is throwing error but for standard field if
I am passing null (not empty string) it is not throwing any error as described above.
Thanks
Hi praneethkumar,
After checking the Mandatory property of LogisticsPostalAddress's field "City" and "state", It has been set to "NO". So they can be Null. How do you set the this property of the customer field "CustomField". Please check it.
Does any one has any idea on this ?
André Arnaud de Cal...
294,095
Super User 2025 Season 1
Martin Dráb
232,866
Most Valuable Professional
nmaenpaa
101,158
Moderator