How to create list page and link with master page in Business Central
Introduction
Hello everyone,
Today we are going to create list page and we will attached same to the any master (Ex. Item) page.
When user will enter data into list page, Primary key of master and Line no will automatically get inserted.
Pre-requisites
Business Central on Cloud
VSCode
Steps:
1. Creating Table and Page
First we will create one table with Line No and Item No. as a primary key, and other fields as per requirements.
After that we will create Page type of ListPart.
We will keep Line no. and Item No editable false.
2. Creating master page extension
So, to add our above page to master page we are going to create page extension for Item.
We added our ListPart page inside part.
- Code to Autoincrement Line No. from 1
Now, we are going to write some code on OnInsert trigger of our custom table. It will help to create unique records.
Item Card page will look like this
On each new record we will assign Item No and generating Line No.
User can hide item No. from list page for better user experience.
Hope this will help.
Thanks for reading.