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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Create own API with filtered data

(0) ShareShare
ReportReport
Posted on by 15

Hi everyone!

I'd like to create an own API for service quotations and service orders. They are written in the same table (Service Header, 5900), so I would like to create two APIs for this table and filter it for quotes and orders.

I'm not an expert in AL so I don't know how to do that. I've this code snippet where I think there must be set a filter.

field(documentType; Rec."Document Type")
                {
                    Caption = 'Document Type';
                }

Thanks for helping!

  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi,

    you need to create a API page for that, for more information and lean you can follow the below link

    learn.microsoft.com/.../devenv-api-pagetype

  • fherrscher Profile Picture
    15 on at

    Hi, thanks for your response!

    Sorry, I was a bit imprecise.

    I know how to create a API page with AL, but I just don't know how to filter data in the API page.

  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    You can follow below link, which will guide to put the filters in API

    learn.microsoft.com/.../use-filter-expressions-in-odata-uris

  • Verified answer
    liki Profile Picture
    5 on at

    Add in API page settings

    -> SourceTableView = where("Document Type" = filter(Quote)) and for another -> "Document Type" = FILTER(Order));

    learn.microsoft.com/.../devenv-sourcetableview-pages-property

  • fherrscher Profile Picture
    15 on at

    Thank you very much!

    That is what I was searching for.

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

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 740 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 531 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 310 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans