Error While Updating Data through OData in D365

Hi

I am getting following error while updating AssetMajorType in D365 using code made available by Microsoft in my On Premise environment. The code is working fine in VPC I have downloaded through LCS. Firstly, the code was only working for insert operation but using cross company parameter it started working for read as well but still it is not working for update operation.

The error I am getting is

{"MajorTypeId":"Z_TEST_01","Description":"Description of Z_TEST_01","AssetType_JP":0,"DataAreaId":"dat","FixedAssetGroup":null}
Asset Major type of ID Z_TEST_01 successfully created and read.
Exception Microsoft.OData.Client.DataServiceRequestException: An error occurred while processing this request. ---> Microsoft.OData.Client.DataServiceClientException: {"Message":"The path fabric:/data/AssetMajorTypes(MajorTypeId='Z_TEST_01',dataAreaId='dat') does not exist."}
--- End of inner exception stack trace ---
at Microsoft.OData.Client.SaveResult.HandleResponse()
at Microsoft.OData.Client.BaseSaveResult.EndRequest()
at Microsoft.OData.Client.DataServiceContext.SaveChanges(SaveChangesOptions options)
at Microsoft.OData.Client.DataServiceContext.SaveChanges()
at ODataConsoleApplication.SimpleCRUDExamples.SimpleCRUD(Resources d365) in C:\Users\ssarang.TIMG\Downloads\Dynamics-AX-Integration-vpc\ServiceSamples\ODataConsoleApplication\SimpleCRUDExamples.cs:line 34
at ODataConsoleApplication.Program.Main(String[] args) in C:\Users\ssarang.TIMG\Downloads\Dynamics-AX-Integration-vpc\ServiceSamples\ODataConsoleApplication\Program.cs:line 46
Exception details Microsoft.OData.Client.DataServiceClientException: {"Message":"The path fabric:/data/AssetMajorTypes(MajorTypeId='Z_TEST_01',dataAreaId='dat') does not exist."}

Related
Recommended