Search code examples
axaptadynamics-ax-2012aotdynamics-ax-2012-r2

Something like setVisible() for Dynamics AX 2012


Is there any way to do that?

I mean, if the form fullfill specific conditions setVisible true or false to a control in the form? Or if i check a CheckBox, show some specific ComboBox?

Thanks in advance for your help


Solution

  • I would recommend enabling and disabling fields, rather than hiding them.

    Open a Supplier, and on the Invoice and Delivery fast tab choose select the Calculate withholding tax CheckBox. This is the VendTable form. The Calculate withholding tax control will enable and disable a second control depending upon the value selected.

    VendTable.TaxWitholdCalculate

    The second control has it's property AutoDeclaration set to Yes, and the event that fires the change can be found on the forms VendTable data source. Find the relevant field (VendTable > Data Sources > Vend Table > Fields > TaxWithholdCalculate) and notice that the modified method has been overridden, changing the control's enabled property. It also has a visible property should you want to remove it from view.

    VendTable.TaxWitholdCalculate2

    Top Tip: In case that you are not aware, you can right click on any control on a form and choose the Personalise option from the context menu. From there is a form which contains a very useful box called System name. You can find the name of the control/table field from this.

    VendTable.TaxWitholdCalculate3