Monday, November 27, 2017

AX - How pass table (datasource) as param to form

In menu item on caller form you must define DataSource property:







This ProdTable will be passed as parameter to called (here) form.

In called form you override init() method:

FormRun callerForm;
FormDataSource callerDataSource;
...
public void init()
{
    super();

    if ( element.args() && element.args().caller() )
    {
        callerForm = element.args().caller();

        if ( callerForm && callerForm.dataSource() ) {

            /* -- save DataSource */

            callerDataSource = callerForm.dataSource();

            /* -- call check method */

            this.check();
        }

    }
}

No comments:

Post a Comment