17 Feb 2015

Filtering data in a grid based on parameter passed from one form to another form


You need to override the init method of the data source of your form following this way for example:

public void init()
{

    SysDimension        SysDimension;
    ;
    super();

    if( element.args().parm())

    {

        SysQuery::findOrCreateRange(this.query().dataSourceTable(tablenum(Dimensions)),      fieldnum(Dimensions, DimensionCode)).value(queryValue(element.args().parm()));

    }

    else

    {

        SysQuery::findOrCreateRange(this.query().dataSourceTable(tablenum(Dimensions)), fieldnum(Dimensions, DimensionCode)).value(queryValue(SysDimension::Department));
    }
}

No comments:

Create number sequence in D365 FO

Create the data type. Add code in the loadModule method of the appropriate NumberSeqModule subclass. Add a method to the module’s paramet...