Mandatory DialogField

When adding controls to a standard form, either bound to a data field or not, one useful property is the Mandatory property. If this is set, then the control is shown with a red squiggly line if no value has been entered, and an error will automatically be shown when the user tries to save the record or close the form. This article describes how to also make this functionality available from dialog forms. You need to define the mandatory property in a DialogField class, as shown below.

1. Add mandatory method into DialogField class:

2. Add into unpack method following lines:

This solution was sourced from a post by ''Regards! Ruslan on the the microsoft.public.axapta.programming'' newsgroup.