Defaulting fields using code
Before we continue, let's check off what we've done in our requirement list:
The next task is to have our program fill in the customer name, address, and so on when the Customer No. field is filled in. We'll draw inspiration from our Sales Header table. Working with the Sales Order table, we know that the customer information is automatically populated when the Sell-to Customer No. field is entered.
Let's go back to the Sales Header table, click on the Sell-to Customer No. field, and go to the C/AL code by pressing F9. Scroll down (or press Page Down) until you find some reference for Address.
Looking at the code here, you can probably guess that GetCust is a function to get the customer information. To verify this, use the Find function (Ctrl + F) to search for GetCust. You can also highlight the GetCust word, right-click, and click on Go to Definition....
When we use Go To Definition..., the function in question will be brought up. If we use the Find (Ctrl + F...