New resources available on Microsoft Learn
Did you know that Microsoft Learn offers free training modules to assist you on your path to mastering Dynamics 365 for Finance and Operations? Become an expert at your own pace or share with your team to foster growth.
Dynamics 365 2019 release wave 2 plan Discover the latest updates to Dynamics 365.Release Plan | Weekly Deployment Notes
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants.Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements.
ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance and Operations TechTalks | Customer Engagement TechTalks | Talent TechTalks
We have a scenario where we need to call Purchase Order request change through OData, can you tell me which event handler or method i should use to PurchPurchaseOrderLineV2Entity trigger VersioningPurchaseOrder.createChangeRequest().I have already tried some they are PurchPurchaseOrderLineV2Entity_onValidatedWrite() & PurchPurchaseOrderLineV2Entity_onPostedLoad() but every time we are getting same error as below
"message": "An error has occurred.",
"message": "Write validation failed for table row of type 'PurchPurchaseOrderLineV2Entity'. Infolog: .",
"stacktrace": " at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateProcessor.CreateEntity_Save(ChangeOperationContext context, ChangeInfo changeInfo)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateManager.<>c__DisplayClass5_0.<CreateEntity>b__1(ChangeOperationContext context)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.ChangeInfo.ExecuteActionsInCompanyContext(IEnumerable`1 actionList, ChangeOperationContext operationContext)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.ChangeInfo.TrySave(ChangeOperationContext operationContext)\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateManager.SaveChanges()\r\n at Microsoft.Dynamics.Platform.Integration.Services.OData.AxODataDelegatingHandler.<SaveChangesAsync>d__2.MoveNext()"
The error says that the data you provide isn't valid. Put a breakpoint to PurchPurchaseOrderLineV2Entity.validateWrite() and check out where it's failing.
Thanks for the reply Martin,
Tried debugging PurchPurchaseOrderLineV2Entity.validateWrite(), it returns false through below statement. it seems like PO RecVersion is change after createChangeRequest() & system is checking for any updates on PO. correct me if i am wrong.
if (!PurchTable::find(this.PurchaseOrderNumber).checkUpdate(true, true, true))
Business Applications communities