Pass values to some StringEdit from a form to another form on Dynamics ax 2012

1.3k Views Asked by At

I dont have idea how to fill StringEdit text from Init where I catch values from a method in another form, please help me :c

Here the click method in the first form

void clicked()
{
    Args args;
    FormRun formRun;
    BBP_TableClientes _BBP_TableClientes;
    BBP_ClassesPuntoDeVenta _BBP_ClassesPuntoDeVenta;
    super();
    args = new args(formstr(BBP_NuevaVenta));
    args.record(BBP_TableClientes);
    formrun = classfactory.formrunclass(args);
    formrun.init();
    formrun.run();
    formrun.wait();
    formrun.detach();
}

and here the init in the other form

public void init()
{
    BBP_TableClientes _BBP_TableClientes1;
    super();
    _BBP_TableClientes1 = element.args().record();
    BBP_TableClientes_ds.query().dataSourceTable(Tablenum(BBP_TableClientes)).addRange(fieldNum(BBP_TableClientes,ID_Cliente)).
    value(SysQuery::value(_BBP_TableClientes1.ID_Cliente));
}

I fill a table with that source but I want to fill some StringEdit with that information.

1

There are 1 best solutions below

3
On BEST ANSWER

If you want to pass between forms just a simple string you can use 'parm' method of 'Args' class:

args.parm("My text");   

Than you need to set property AutoDeclaration on your StringEdit control to Yes,

enter image description here

after that you will be able refer it by name and set the value:

StringEdit.text("My text");
StringEdit.text(element.args().parm());
StringEdit.text(_BBP_TableClientes1.ID_Cliente);