Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Unanswered

Multiple parts to same Page from an API page

(0) ShareShare
ReportReport
Posted on by 5

Hello,

We want to make an API page to get Location related information on Transfer Header so we have a Location Page called "APIV2 - Location" and we add the relation to ZeroOrOne on the TransferHeader page like this:

part(transferFromLocation; "APIV2 - Location")
{
    Caption = 'Transfer From Location';
    EntityName = 'location';
    Multiplicity = ZeroOrOne;
    SubPageLink = Code = Field("Transfer-from Code");
}

part(transferToLocation; "APIV2 - Location")
{
    Caption = 'Transfer To Location';
    EntityName = 'location';
    Multiplicity = ZeroOrOne;
    SubPageLink = Code = Field("Transfer-to Code");
}

part(inTransitLocation; "APIV2 - Location")
{
    Caption = 'In Transit Location';
    EntityName = 'location';
    Multiplicity = ZeroOrOne;
    SubPageLink = Code = Field("In-Transit Code");
}

This code can be packaged but the metadata shows error 500:

{
  "error": {
    "code": "BadRequest_InvalidArgument",
    "message": "An incompatible property definition already exists for transferHeader.location."
  }
}
 

If we try to change the EntityName then the AL COP shows the error: 

The page 'APIV2 - TransferHeader' of type 'API' and its control 'transferFromLocation' of type 'Part' must have the same value of property 'EntityName'.ALAL0532
There is any way to do that?
Thank you

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans