cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rosirsosss
New Member

Unable to add Purchase Order (PO) number to Pending Vendor Invoice

hello, We are trying to use PA and AIBuilder and pushing vendor invoices into D365. We are successful in reading the vendor invoices and pushing it into D365 - the extracted invoice fields and the invoice preview is visible in "Pending Vendor Invoice" in D365. One thing we are missing is the ability to insert the Purchase order value into Pending Vendor invoice in D365

 

The approach we used to create the invoice in D365 --> using the PA connector "Fin & Ops Apps (D365)" and Action "Create record" and Entity "VendorInvoiceHeader". This entity does not have a PO number field so we are not able to pass the PO we have extracted from the invoice while creating the invoice in D365.

 

Is this by design? or should i being using a different entity while creating the invoice? or do i have to add another step in PA to add the PO to the vendor invoice created? Please let me know if anyone has been able to do this.

 

Note: we are using a trial instance of D365.

After the invoice is created in D365, i am able to manually select the PO number to the invoice.

 

thank you

2 REPLIES 2
rosirsosss
New Member

Posted the same topic to the Dynamics 365 community (and a few MS friends). They seem to confirm that PurchaseOrderNumber field should be available inVendorInvoiceHeader entity. But this field is not available on the Create Record action when the VendorInvoiceHeader entity is selected.

 

is this a bug? please check below link - it has screen shots for reference.

 

https://community.dynamics.com/365/financeandoperations/f/dynamics-365-for-finance-and-operations-fo...

Expiscornovus
Super User II
Super User II

Hi @rosirsosss,

 

As a workaround I tried using a POST and Patch via OData:

Open Data Protocol (OData) - Finance & Operations | Dynamics 365 | Microsoft Docs

 

But I am getting insert not allowed for field error for POST and a update not allowed for field error for a PATCH on the VendorInvoiceHeaders entity.

 

{
  "error": {
    "code": "",
    "message": "An error has occurred.",
    "innererror": {
      "message": "insert not allowed for field 'PurchaseOrderNumber'",
      "type": "Microsoft.Dynamics.Platform.Integration.Services.OData.ODataSecurityException",
      "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__DisplayClass10_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__3.MoveNext()"
    }
  }
}

 

{
  "error": {
    "code": "",
    "message": "An error has occurred.",
    "innererror": {
      "message": "update not allowed for field 'PurchaseOrderNumber'",
      "type": "Microsoft.Dynamics.Platform.Integration.Services.OData.ODataSecurityException",
      "stacktrace": "   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.UpdateProcessor.UpdateEntity_Save(ChangeOperationContext context, ChangeInfo changeInfo)\r\n   at Microsoft.Dynamics.Platform.Integration.Services.OData.Update.ChangeInfo.<AddAction>b__1_0(ChangeOperationContext operationContext)\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__3.MoveNext()"
    }
  }
}

 

patch_vendorinvoiceheader.png

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,411)