Now, it's time to write the business logic code.
As a best practice (https://community.dynamics.com/nav/w/designpatterns), we don't want to have code inside tables or pages so here we create two Codeunit objects:
- Customer Management Codeunit: Contains all the business logic related to managing the Customer and Customer Category
- Free Gift Management Codeunit: Contains all the business logic related to managing the Free Gift process
To create these Codeunits, we create two new AL files in the Src\CustomerCategory\codeunit and Src\Gifts\codeunit folders with the names of Cod50100.CustomerManagement.al and Cod50101.FreeGiftManagement.al, respectively.
We use the tcodeunit snipper to create a new ...