Before manipulating the data, it's a good idea to make sure that the data you are inserting, updating, or deleting doesn't break any of the rules you have set for the table you are manipulating.
These rules are typically to check that all mandatory fields have data in the buffer that you are trying to insert or update, or to check that the record you are about to delete doesn't have any related records in the tables set up with a restricted delete action.
A validation method should always return a Boolean value. This value will be true
if the validation is OK and false
if it's not OK.
If you don't use the validation methods, you will be allowed to have records with mandatory fields empty when inserting or updating records from X++. You will also be allowed to delete records that have restricted delete actions against other tables. This means that you are likely to get unreferenced data if you don't use validation methods.
There are three data validation methods used in...