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

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!

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,692 Moderator on at
    RE: Create own API with filtered data

    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
    RE: Create own API with filtered data

    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,692 Moderator on at
    RE: Create own API with filtered data

    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
    RE: Create own API with filtered data

    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
    RE: Create own API with filtered data

    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

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 3,761

#2
Sumit Singh Profile Picture

Sumit Singh 2,611

#3
YUN ZHU Profile Picture

YUN ZHU 1,975 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans