Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Answered

Web services - how do you find the right object to use?

Posted on by 40

I am trying to make some PowerBI reports on our sales order lines.

To do that I am using webservices (ODATA v4).

I thought it would be as easy as putting in the table ID, and then publishing that able as a web service. But you cannot choose tables, you can only choose something called "objects": Each object has an ID, but it does not correspond to the table IDs.

How do I find the specific table among all the objects? The table I want is table 37, sales lines. There are some objects called "sales lines" or just "lines", and some of them have some of the data I need, but all of them is missing some specific columns.

Categories:
  • phkGZ Profile Picture
    phkGZ 40 on at
    RE: Web services - how do you find the right object to use?

    you guys are all amazing, thanks! very very helpful

  • Verified answer
    YUN ZHU Profile Picture
    YUN ZHU 69,864 Super User 2024 Season 2 on at
    RE: Web services - how do you find the right object to use?

    Hi, As you said, in Web Service we can only publish Page or Query to access data. And the system standard page may miss the columns we need.
    So generally, wo create new pages and publish in Web Service. This requires customization. 

    If you don't want to customize and find all pages source table is 37, you can try the following method.

    You can force Business Central to run the “Page Metadata” table by adding the ?table=2000000138 parameter to the URL, such as in the following example: 

    businesscentral.dynamics.com/.../Sandbox01?table=2000000138

    pastedimage1642120366426v1.png

    Then filter sourcetable as 37.

    pastedimage1642120458770v2.png

    You will get all pages that use table 37 in Business Central.

    pastedimage1642120468886v3.png

    Hope this will help.

    Thanks.

    ZHU

  • Verified answer
    S.Kawamura Profile Picture
    S.Kawamura 1,520 on at
    RE: Web services - how do you find the right object to use?

    Hi,


    In the Sales Order screen, click Ctrl+Alt+F1.A page similar to the following will appear.
    pastedimage1642084243413v4.png

    Click on a Lines section in the Sales Order page to focus on it, and it will be surrounded by an orange frame.
    In this state, look at the frame on the right. You can see that table is "Sales Line (37)" and page is "Sales Order Subform (46, ListPart)".
    What the WebService uses is the PAGE information.

    In general, it is sufficient to create a WebService by specifying the "Page" number in the image above in the following manner.
    pastedimage1642084301291v6.png

    But in this case, Page ID 516 named "Sales Line" would be better for you.
    pastedimage1642084261196v5.png

    I hope this will help you.

    S.Kawamura

  • Verified answer
    tlhgolfer Profile Picture
    tlhgolfer 761 on at
    RE: Web services - how do you find the right object to use?

    What I normally do it go to the page where I am searching for the data and I choose the question mark and go to help and support.  Then I will choose inspect pages and data and view there the tables.  When you are in web services you can choose a Page or Query to get to the data.  You most likely will have to combine these in Power bi or Excel to get fields from multiple tables.  You can also have a custom API built if you are not using Power Bi.  If you are using Power Bi to connect to the data what is really cool after you connect to the header table you will see a double arrow going in opposite directions on the field in the transform data area.  This will allow you to connect to the table below such as the sales lines without having to use multiple tables.

    Happy to help if you need more information.

    Tanya

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,552 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,552 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans