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

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Obtain URL query parameters

(0) ShareShare
ReportReport
Posted on by 2

Is it possible in business central to programmatically obtain the query parameters for the current page?

Scenario:

  1. Hyperlink to a website that is external to business central
  2. User fills in form and submits on external website
  3. External website redirects back to business central and appends query parameters to the URL containing details related to the form submission

The external website interaction and redirect with query parameters are outside of my control.

Any thoughts are appreciated.

I have the same question (0)
  • Suggested answer
    Andy Sather Profile Picture
    on at

    Hello  - We currently do not have dedicated Dev support via the Dynamics 365 Business Central forums, but I wanted to provide you some additional resources to assist.  If you need assistance with debugging or coding I would recommend discussing this on one of our communities.

    www.yammer.com/dynamicsnavdev

    I will open this up to the community in case they have something to add.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at
  • xorlogic Profile Picture
    2 on at

    Thank you, Andy Sather. I followed your link to the yammer group, but I believe I will need an admin's approval before proceeding there.

    Thank you, NorthW. Unfortunately, this does not speak to my needs. The query parameters that I am referencing will be defined by an external website and do not relate to core Business Central in any way. What I need is a way to reference those query parameters from within my extension's AL code so that I can do something with the information that they represent.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    So you want the external website to call a Business Central API?

    Then you can create a custom API in AL

    docs.microsoft.com/.../devenv-develop-custom-api

  • xorlogic Profile Picture
    2 on at

    Interesting. The custom API may hold some promise.

    I could specify a custom GET endpoint and have the external website redirect back to that on form submission. Presumably there won't be any issues with the HTTP as long as no specific auth is required. I'm still not seeing anything about accessing query parameters and I'll have to modify the examples to somehow save in the request handler instead of merely returning data. Maybe I'll be able to stumble into something there.

    Thanks for the reference! I'll look into it some more.

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    You need to define your API, that also can be a to match the parameters in the http call.

    Here is a blog around using codeunits as API. I think that is the solution for you in this case.

    www.kauffmann.nl/.../

  • xorlogic Profile Picture
    2 on at

    Fascinating! Thanks for all your feedback.

    The required auth credentials, expected as they are, still make this just out of reach for the external website which is merely performing a redirect off of the original page (3rd party, not in my control and won't change) and won't be including anything at that level in the request.

    However, a custom built intermediary with the ability to translate the redirect request into a meaningful REST request back to BC could be a way to work around the disconnect.

    Thanks again!

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,111 Moderator on at

    My pleasure, happy to help!

    Please mark the question as answered if you found my help useful. That way you help both me and the community.

    You could also let the 3.party webside call an Azure logic app or Azure website that you control. And then you can do the call to Business Central from there. We have done that in some cases.

    Happy coding!

  • xorlogic Profile Picture
    2 on at

    Continuing to explore this I actually came up with a better solution using a "control addin".

    Basically, the external web page will redirect back to a page in business central. This business central page will have a very simple control addin with custom JS that grabs the window.location and sends it to the control addin's callback.

  • Suggested answer
    YUN ZHU Profile Picture
    95,595 Super User 2025 Season 2 on at

    Hi, if you just want to returns the URL of the current page, you can use System.GetUrl() Method:.

    https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/system/system-geturl-clienttype-string-objecttype-integer-table-boolean-method

    And just add another solution, this can also be done with Power Automate.

    https://yzhums.com/20111/

    Hope this helps as well.

    Thanks.

    ZHU

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,010

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,270 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,085 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans