How to add custom lookup (Multi Companies)in Dynamics AX 2012 Through X++

public void lookup(FormControl _formControl, str _filterStr)
{
        //super(_formControl, _filterStr);

        Query                               query                               = new Query();
        QueryBuildDataSource    queryBuildDataSource;
        SysTableLookup               sysTableLookup;

        query.allowCrossCompany(true);

        sysTableLookup          = SysTableLookup::newParameters(tableNum(TaxGroupHeading), _ formControl);
        queryBuildDataSource    = query.addDataSource(tableNum(TaxGroupHeading));
        //Query.addCompanyRange("Company Id");

        sysTableLookup.addLookupField(fieldNum(TaxGroupHeading, TaxGroup));
        sysTableLookup.addLookupField(fieldNum(TaxGroupHeading, TaxGroupName));


        sysTableLookup.parmQuery(query);
        sysTableLookup.performFormLookup();
}

Comments

Popular posts from this blog

How to loop through enum in dynamics ax 2012 using x++

How to read from csv file in Dynamics AX 2012 Through X++

How to Create Transfer Journal in Dynamics AX 2012 Through X++