Hello,
I am trying to make an automation using Power Automate that will allow our finance team to approve the import of Vendor Bank Details so that they are not doing this manually anymore. I have created an API Page for the Vendor Bank Account, that includes among others the Vendor No. and Code, which are required fields. The first one is required to link the bank account details to the vendors. The Vendor No is available from a previous step in the automation. The field type in VS Code is of type Code [20]. The second one is also of type Code [20] and required to identify the bank account entry, so that it can be selected as the valid record on the Vendor Card (a vendor can have multiple bank account details associated with it, but only one counts as the valid one that BC will use to make payments for example).
The other fields that I have added are IBAN and Swift Code for example, which also are of type Code [20]/[50].
I have published the page and I'm able to find it using the Create Record D365 BC connector in Power Automate. However, the Vendor No and Code do not appear in the connector, only the other fields. And if I try to run it as is, it will fail due to the Vendor No and Code missing.
I am using QA as a testing ground before I can publish the API to Production.
I tried adding the following line in my code:
ODataKeyFields = "Vendor No.", "Code";
As I read it may need to be included, but it does not make a difference. In the end, the automation always ends in error with the following error message:
ErrorCode: Application_FieldValidationException Vendor No. must have a value in Vendor Bank Account: Vendor No.=, Code=. It cannot be zero or empty.
Can anyone help me understand what is wrong and how I can fix this?
Thank you!