[AX 2012] Modify form field value in X++

This question is not answered

Hi, 

how do i modify the value of a form field in X++?

 

I  found SetValue() method but doesnt seem to work out. 

Is there a .value property which can be set in order to change the value of a field at runtime?

 

Thank you in advance 

regards

All Replies
  • Are you speaking about dialog controls, or form controls?

  • Form controls. More exactly i'm trying to set a text field's value.

  • Ok, the easiest way to do so is:

    1.- Set the Autodeclaration property of the control to Yes.

    2.- Now, to set the value in X++, put the name of the control, and the proper method (varies based on the basic data type of the control).

    Examples:

    StringEdit.text("Hello");

       RealEdit.realValue(4.5);

       IntEdit.value(5);

       ComboBox.selection(2);

  • hey,

    try to save it direkt to the table.

    eg.

    inventTable.field =  value

    inventTable_ds.refresh()