Besides displaying table data in different formats, Dynamics NAV pages enable C/AL developers to extend functionality by creating action buttons that execute C/AL code when pushed. As an example of the page action, we will augment the contract page with an action creating sales invoices based on the payment schedule. For simplicity, we will not store the whole payment schedule and invoice history, but will note only the date of the last invoice. To keep this date, a new field in the Lease Contract Header table is required. So, before continuing with the action, open 50500 Lease Contract Header table, in the table designer and add a field, Last Invoice Date, as per this table:
Field no. | Field name | Data type |
10 | Last Invoice Date | Date |
This is going to be an internal field, used in the code, so we will not show it in the page.
Now, save the table...