I'm new to AL Language and would like to build a Freight Calculator as project to get started.
I was able to create a Table, a list page and a card page using VS Code. With this created, I also managed to use the Configuration Packages Page to import data into my newly created Table... this was somewhat self explanatory.
Where I'm having a hard time is finding information about the followings:
My Table has 11 columns, Origin City, Service Type, Destination City, Destination Province, Base Rate, then 6 other columns of rates based on weight.
I need to create a UI where the user can select their Origin City, Service Type, Destination City and Province and input the weight that they would like to ship. The result would be the price for the freight.
I understand that this might not be as easy as doing it in c# Winform, but there must be a way.
I'm not looking for someone to write it for me but more info on where to get started.
Thanks in advance.
Don't be scared, it's not so complicated as it might look, even compared to WinForms.
Previous post gives a good starting point for UI, and there is more documentation and examples available online. For example, here you can find an overview of different page types in BC: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-pages-overview
What you are looking for is probably a List type page, but you can experiment with various page types and see what suites your purpose.
To enable lookups to other tables, you will need to set up table relationships. This actually means that you define foreign keys in your custom table and specify respective primary keys. This is all it takes to enable the lookup functionality:
i/'ll be certain to post my findings online as there isn't much about AL anywhere. Even stack overflow is very lean in that department.
thanks for your time.
Unfortunately, now information on AL development is not as pletiful as developers would desire. Dynamics NAV is in the state of rapid transition to Business Central, and I can't say that this process is absolutely smooth and painless. Technology is changing faster than the related documentation is updated. Hopefully, it is going to be fixed soon - by the developers' community, as well as by Microsoft.
page 50101 "Sample Page"
PageType = Card;
// SourceTable = TableName;
Caption = 'Item';
TableRelation = Item;
You can remove the property "SourceTable" completely if the page is not based on any table. Just declare global variables you need and bind them to page controls. Property "TableRelation" can be defined in the page instead of a table to support the lookup functionality.
This looks like exactly what I want to do... Thanks!
I'm surprised I haven't been to find an example online... Alright, I'll give it a try.