Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Business Central forum

Best way to copy core API pages (instead of extending them)?

(0) ShareShare
ReportReport
Posted on by

Another forum user linked me to this post on GitHub: https://github.com/Microsoft/AL/issues/4434

In short, come April, using "pageextension" objects for core API pages will no longer be allowed; custom "page" objects are to be used, instead (the official documentation for "pageextension" objects confirms this).

The suggestion is to copy an existing core API page and modify it to suit your needs, but, unless I'm doing this wrong (highly possible), this is an incredibly tedious process, to the extent that there really has to be a better way. If I'm in Visual Studio Code and I type something like:

pageextension 50100 "Test Extension" extends "Sales Invoice Entity"
{
 ...
}

I can right-click "Sales Invoice Entity" and navigate to the code for that page (5475). It shows up in VSC as "Sales Invoice Entity.dal"; if I copy and paste the entire file's contents into a new file, change the number/name of the page object, add in all the page metadata (e.g., "PageType = API;" and "APIPublisher = 'myCompany';" and so on), then save it as a new .dal file, it doesn't get packaged into my extension.

It seems the only way to make it work as a custom API page is to save it as a .al file, add "Caption" and "ApplicationArea" lines to every field, make sure to add "TableRelation" fields where necessary, make sure the triggers have "trigger" in front of them (they don't in the .dal file) and the remaining procedures have "procedure" in front of them, etc.

This is super time-consuming. Is there a better way to copy-paste a core API page, convert it into a new custom API page, and just add a couple lines to include the fields/logic I want?

Thanks,

Dave

Categories:
  • I Gusti Made Ari Profile Picture
    3,594 on at
    RE: Best way to copy core API pages (instead of extending them)?

    if you want to convert standard object to al, yes you need a cronus standard database for that ( either using docker or install bc on premise in your local pc).

  • Community Member Profile Picture
    on at
    RE: Best way to copy core API pages (instead of extending them)?

    I Gusti Made Ari Permadi,

    Sorry for the slow reply. Is all this really necessary? We're not using Docker or NAV 2018 or anything. We have a client using Business Central and we've developed a very simple extension for them that just does a couple little things not handled natively by the API. Right now it works fine as a bunch of page extensions that contain very little code -- to have to go through this entire process with all the extra installations (Docker and NavContainer) just to slightly extend core API functionality seems...ridiculous, honestly. Is there no other way?

    Thanks,

    Dave

  • Verified answer
    I Gusti Made Ari Profile Picture
    3,594 on at
    RE: Best way to copy core API pages (instead of extending them)?

    You can modify your solution for standard API Page on docker BC sandbox .

    Detail on how to install docker and setup , can check below link :

    blogs.msdn.microsoft.com/.../navcontainerhelper-setup-cside-development-environment-with-source-code-management

    After you have done your modification , run below function of the navcontainer helper :

    Convert-ModifiedObjectsToAl -containerName $containerName -startId 50100 -openFolder

    it will convert your modification into .AL with new ID (based on startID parameter)

    This command basically will invoke the 4 commands in order to export modified objects and convert them to AL:

     1. Export-NavContainerObjects

     2. Create-MyOriginalFolder

     3. Create-MyDeltaFolder

     4. Convert-Txt2Al (docs.microsoft.com/.../devenv-txt2al-tool)

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,274 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,933 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans