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

Community site session details

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

Retrieving GLN Number through api

(0) ShareShare
ReportReport
Posted on by 45

As our business is B2B, it's important for us to be able to retrieve the GLN number through the api, but it seems harder than it should be..

How could i possible get the GLN number from a customer easiest ? I've looked at others telling you need to create a custom api, but the tutorial creating a custom api is minimal, is it really needed to create a whole new custom api just to get a basic property on a customer? If yes, are there any better tutorials out there how to set it up?

I guess getting the GLN number should be easy as getting the rest information, so why doesn't it come with the standard API response?

I have the same question (0)
  • Suggested answer
    MahGah Profile Picture
    15,527 on at
    RE: Retrieving GLN Number through api

    Hi

    These are my assumptions 1) You already published Page 21 (Customer Card) 2) GLN field is visible in this page (if not you need to make it visible) 

    Then go to Web service Page Action -> New Document -> Create Dataset then Edit Existing and select Customer Card in the next page you will see all fields. Select GLN and publish. You should see GLN now. 

  • Izet Profile Picture
    45 on at
    RE: Retrieving GLN Number through api

    I didn't do anything else than opening up the rest api, (Im still new to BC)

    Do you mean under "Web services" ? I tried to make a object with value 21, but that's "debtorpost" ?

    Thanks for fast answer

  • Suggested answer
    MahGah Profile Picture
    15,527 on at
    RE: Retrieving GLN Number through api

    Sorry I thought you want to use ODATA of Webserivce.

    if ODATA works for you then go to Web Services page in BC and do below. Please note you can create Query then publish in BC then publish as webservice as well (https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-query-object) but without Query you need to try below. 

    pastedimage1654607430053v3.png

    Then check that ODATA link to see if you have the field in that ODATA. if yes then you are done.

    If no, then below.

    Try to publish Page 22 (Customer List) then check. if it is not there as well then you need to first add that field into Customer List  (using Design in Sandbox see this  https://yzhums.com/21735/ ) 

    Then go back to Web Services and do this 

    pastedimage1654608123699v4.png

    pastedimage1654608254440v5.png

    pastedimage1654608275865v6.png

    Then below you can select any fields you need then publish and use ODATA

    pastedimage1654608304323v7.png

  • Izet Profile Picture
    45 on at
    RE: Retrieving GLN Number through api

    Works!

    Sorry, im still new, so the interface is a bit hard to figure out :)

    Thanks! :)

    - Is it maybe possible to include this data in the standard "customer" GET ? Or should i just use two calls? :)

  • Verified answer
    MahGah Profile Picture
    15,527 on at
    RE: Retrieving GLN Number through api

    Perfect.

    Just for future reference (for another person that need the same function) which page worked?

  • Izet Profile Picture
    45 on at
    RE: Retrieving GLN Number through api

    Page 21, as page 22 didn't have the GLN number :)

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

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

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 4,330

#2
Sumit Singh Profile Picture

Sumit Singh 2,738

#3
Nimsara Jayathilaka. Profile Picture

Nimsara Jayathilaka. 2,546

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans