Showing posts with label code. Show all posts
Showing posts with label code. Show all posts
Tuesday, July 24, 2018
Thursday, January 16, 2014
How to set properties for the Reference Group form control from code
There is a small issue in AX 2012 with getting access to the siblings' properties of Reference Group form control - they are unavailable in AOT.
However, you still can get access to it from code during run time.
Let's say you have placed on your form a field named FilterCategory, which is a reference group, and you want to set its sibling FilterCategory_Name width to Column width value. As you can see there is no way to do that in AOT.
So you just create a method supposed to be called in the form init():
And you get it!
However, you still can get access to it from code during run time.
Let's say you have placed on your form a field named FilterCategory, which is a reference group, and you want to set its sibling FilterCategory_Name width to Column width value. As you can see there is no way to do that in AOT.
So you just create a method supposed to be called in the form init():
void setColumnWidthForFilterCategory() { int i; Object childControl; for (i = 1; i <= FilterCategory.controlCount(); i++) // FilterCategory is of FormReferenceGroupControl type { childControl = FilterCategory.controlNum( i ); childControl.width( 0, FormWidth::ColumnWidth ); } }
And you get it!
Labels:
AOT,
AX2012,
code,
design,
form,
form control,
reference group
Subscribe to:
Posts (Atom)


