Hi,
I am making ODATAv4 requests to a Dynamics 365 BC instance (NAV 14.0).
I am trying to post invoices (not POST as in the HTTP method, but post as in 'move the invoice from draft status into the customer ledger' etc.). It's not working.
Here is the request I am making and the error message I get back
POST ?..blah/Company('CompanyABC')/SalesInvoice('Invoice','489362')/NAV.Post
{
"error":
{
"code": "Unknown",
"message": "Object reference not set to an instance of an object."
}
}
I've also tried /Microsoft.NAV.post
I have changed the visibility of the post function on the SalesInvoice page to external and enabled the service as follows, as below:

But this did not fix the problem. I don't even know if I am hitting the function when I send the OData request.
I've looked at the following pages (and a lot more in the same vein) but I can't figure it out:
mydynstories.wordpress.com/.../
docs.microsoft.com/.../walkthrough-creating-and-interacting-odata-v4-bound-action
community.dynamics.com/.../905582
Can anyone suggest what I can do to fix this? I think I must be missing something obvious.
Simple suggestions are welcomed as I am a complete Dynamics novice.