web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Bound action on custom API - getting BadRequest_NotFound

(1) ShareShare
ReportReport
Posted on by 9
Hi, I hope this question has not been answered before as I have searched and read my eyes dry for information.

I have a page, Pagetype = API, and i want to call the procedure Test which i have given the [ServiceEnabled
attribute.
The EntitySetName is 'customers'.

I am using this link format and i have been trying with GET and POST but it doesn't make a difference.

https://api.businesscentral.dynamics.com/v2.0/tenant/Sandbox/api/APIPublisher/APIGroup/APIVersion/companies(GUID)/customers(GUID)/Nav.Test


I have looked into the Microsoft V2 API source, example Page 30037 APIV2 - Sales Quotes where the MakeOrder service is exposed and that works fine.

By mentioning that, my problem is that i want to make an order from a quote, but i also want to have the new order number returned but i only get an empty 204 response.

Looking into the native makeOrder API, this is the last code that is executed:

ActionContext.AddEntityKey(FieldNo(Id), SalesHeader.SystemId);
ActionContext.SetResultCode(WebServiceActionResultCode::Deleted);


Our sandbox environment is on version 19 .

Thank you for your time and help

Kindly
Andreas
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    102,849 Super User 2026 Season 2 on at

    Hi, I recently added a new Action to Power Automate, hope this will give you some inspiration.

    https://yzhums.com/20111/

    Thanks.

    ZHU

  • Suggested answer
    Wishdale Profile Picture
    9 on at

    I resolved it

    Apparently the bound action is renamed with initial lowercasing, MyProcedure becomes myProcedure (Look it up with $metadata#).

    And the procedure, when called, needs to be prepended with Microsoft.NAV, eg: Microsoft.NAV.myFunction

    Also if you want return values, only primitives seems to be allowed and you can't use the standard procedure pattern;
    "procedure MyProcedure(var ActionContext: WebServiceActionContext)", as the procedure will not be made available if one gives it a return value.

    One needs to give it 0 or more parameters like
    procedure MyProcedure(myParameter: Text): Decimal
    var
        ActionContext: WebServiceActionContext
    begin
     exit(0);
    end;
  • Wishdale Profile Picture
    9 on at

    Thank you!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 518 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 362 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 327 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans