Range by integer fields in Axapta / Dynamics Ax

Is there a way in Axapta / Dynamics Ax to create an extended data type of type integer that only allows you to enter values ​​in a given range (i.e. if the extended data type is designed to store years, I should be able to set a range, for example, 1900-2100 ), or do I need to control the range using X ++ code?

And if I need to use X ++ code to control the range, what is the best way to do this?

+3
source share
2 answers

I suggest you use the "validateField" of the corresponding table. Find the method in AOT \ Data Dictionay \ Tables to see many examples.

+4
source

You cannot specify a range for the most advanced data type. If the type is used for a table field, you can add code to the insert and update methods of the table to check the value whenever the record is updated. However, this approach may have a cost in terms of performance.

You can also simply add code to the validateWrite method of the table if you are satisfied with the validation that takes place only after changing the value from the user interface.

+2
source

All Articles