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();
}
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
Post a Comment