How to Enable or Disable DataSource Fields through code in ax 2012

Description: -

Here we will enable/disable DataSource fields control through code in Ax 2012. Here I have given simple demonstration for enable/disable DataSource fields in form.

Example:-

My DataSource contain Field like “Display” its Enum fields NoYes. In form I have check if there ii get yes then I want to enable this field in form otherwise I don’t want to enable. So I have use below code to enable/disable fields in form. Also you can access more property of that fields.

Code:-

DataSourcename_ds.object(fieldnum(TableName, FieldName)).allowEdit(false);
DataSourcename_ds.object(fieldnum(TableName, FieldName)).visible(false);

Related Posts

Previous
Next Post »

Thanks for comments.....

:)
:(
hihi
:-)
:D
=D
:-d
;(
;-(
@-)
:P
:o
:>)
(o)
:p
:-?
(p)
:-s
(m)
8-)
:-t
:-b
b-(
:-#
=p~
$-)
(y)
(f)
x-)
(k)
(h)
cheer