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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

API SubPageLink: Different runtime behaviors when linked field is not populated in the main page

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

When developing API pages that accommodate for a subpage with a SubPageLink, it is very important to know that different behaviors might occur at runtime, depending on Dynamics 365 Business Central version.

 

Let’s say that you have an API called italianWines bounded to wine entity with a subpage glassTypes that is linked using the field “Standard Glass Type”.

You could then send a GET like

chucknorris:7048/.../italianWines

to list all the italian wines in the specific company.

Now, you cold try to view the standard glass types by adding the $expand parameter like

chucknorris:7048/.../italianWines$expand=glassTypes

 Everything works fine… as long as “Standard Glass Type” is part of the main page.

But what would happen if the linked field, Standard Glass Type, is not part of the main page?

 

The behavior is different depending on Dynamics 365 Business Central version

 

Runtime versions up to and included 16.6

An HTTP 500 Error is thrown like the one below

 

The error is as per the following:

{

    "error": {

        "code": "Unknown",

        "message": "Sequence contains no matching element. CorrelationId:  a4aea12d-23d1-4028-bbcc-bad4e80a382e."

    }

}

SOLUTION: Add the field to the main page  

Runtime versions 16.7 and higher for 16.x, and 17.0

An HTTP 501 not Implemented code will be thrown, instead of a generic HTTP 500 exception, if the linked field is not populated in the main page but is linked via a SubPageLink. This will pinpoint which table field missing is causing the request to fail in order to have this added as part of the main page.

The error is similar to the following:

{

    "error": {

        "code": "BadRequest_MethodNotImplemented",

        "message": "The table field with id no. '9' is missing in the parent API page with entity name 'wine'.  CorrelationId:  8f5f9537-96ab-480c-8262-54fe6b145185."

    }

}

SOLUTION: Add the field to the main page  

 

Runtime versions 17.1 and higher for 17.x

It would work as expected and expand glassTypes.

  • Marco Mels Profile Picture
    Microsoft Employee on at

    Thank you for this blog posting Duilio!

  • Marga Profile Picture
    575 on at

    Great blog!

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 Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,496 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 961 Super User 2026 Season 1

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 870 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans