Skip to main content

Notifications

Announcements

No record found.

Business Central forum
Unanswered

Fetching OData query filters on the page exposed as web service

Posted on by 53
Greetings,
 
we currently have a page which loads data into the temporary record every time page is opened (this is required since data dynamically changes all the time and we can't keep everything permanently in actual DB table).
 
Our client requested from us to open this page as API endpoint, which we did through  "Web Services" BC page. Issue is now that API response is slow since data is loaded into the temp. record every time API call is made. We can send the OData query filters, but they are only applied AFTER data is loaded into the temp. record.
 
Is there any way we can fetch those filters on page in code as soon as request arrives? We would like to get those filters and then set the filters on our own before loading of the data into the temp. table stars.
 
For example, let's say we have next URL with filters: 
  • https://api.businesscentral.dynamics.com/v2.0/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/Client-Environment/ODataV4/Company('SomeCompany')/OpenQuantitiesOverview?$filter=Location_Code eq '61-ZAGREB'
 
Can we fetch the value '61-ZAGREB' directly on the page?
 
Thank you.
Categories:
  • Valentin Castravet Profile Picture
    Valentin Castravet 6,854 Super User on at
    Fetching OData query filters on the page exposed as web service
    Create an API page, its much faster than a regular page exposed as a web service. 
     
  • gdrenteria Profile Picture
    gdrenteria 4,883 Super User on at
    Fetching OData query filters on the page exposed as web service

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans