Bojensen Blogs

Accessing datasource field properties – Axaptapedia

Often it is useful to be able to access the datasource field properties on a form through X++. This is essential for modifying the allowEdit property at run-time for example.

The following code can be used to set the allowEdit of the InventTable.ItemName field on a form.

To prevent editing code when you add fields to the table, call the fieldproperties using the dictionary classes:

Code called from a method on the datasource itself. Check the fldItemName for null, System fields (eg ‘ModifiedBy’) are not present in the datasource, but is in the table.

Accessing datasource field properties – Axaptapedia

Comments are closed.