public void lookup()
{
DimensionAttribute dimensionAttribute;
DimensionAttributeDirCategory dimAttributeDirCategory;
Query query = new Query();
QueryBuildDataSource qbds;
SysTableLookup sysTableLookup;
dimensionAttribute = DimensionAttribute::findByName('Products');
if (dimensionAttribute.Type == DimensionAttributeType::CustomList)
{
select firstonly DirCategory from dimAttributeDirCategory
where dimAttributeDirCategory.DimensionAttribute == dimensionAttribute.RecId;
sysTableLookup = SysTableLookup::newParameters(tableNum(DimensionFinancialTag), this);
sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Value));
sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Description));
qbds = query.addDataSource(tableNum(DimensionFinancialTag));
qbds.addRange(fieldNum(DimensionFinancialTag, FinancialTagCategory)).value(queryValue(dimAttributeDirCategory.DirCategory));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
}
-----------------------------------------------------------------------------------------------------------
1.)create New Class...................
class NaSyslookup extends SysLookup
{
}
Public void lookupDimension(FormStringControl _stringControl, Name _dimensionName)
{
syslookup::lookupDimension(_stringControl,_dimensionName);
}
2.)write code in Lookup override...........................
public void lookup()
{
NaSyslookup cicsyslookup = new NaSyslookup();
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
SysTableLookup sysTableLookup = new SysTableLookup();
//super();
switch (TransType.selection())
{
case 0:
sysTableLookup = SysTableLookup::newParameters(tableNum(DimAttributeOMBusinessUnit), this);
queryBuildDataSource = query.addDataSource(tableNum(DimAttributeOMBusinessUnit));
sysTableLookup.addLookupfield(fieldNum(DimAttributeOMBusinessUnit, Value),true);
sysTableLookup.addLookupfield(fieldNum(DimAttributeOMBusinessUnit, Name));
sysTableLookup.addSelectionField(fieldNum(DimAttributeOMBusinessUnit, Value));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
break;
case 1:
sysTableLookup = SysTableLookup::newParameters(tableNum(DimAttributeOMDepartment), this);
queryBuildDataSource = query.addDataSource(tableNum(DimAttributeOMDepartment));
sysTableLookup.addLookupfield(fieldNum(DimAttributeOMDepartment, Value),true);
sysTableLookup.addLookupfield(fieldNum(DimAttributeOMDepartment, Name));
sysTableLookup.addSelectionField(fieldNum(DimAttributeOMDepartment, Value));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
break;
case 2:
sysTableLookup = SysTableLookup::newParameters(tableNum(DimensionFinancialTag), this);
queryBuildDataSource = query.addDataSource(tableNum(DimensionFinancialTag));
sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Value),true);
sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Description));
sysTableLookup.addSelectionField(fieldNum(DimensionFinancialTag, Value));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
break;
default:
}
}
{
DimensionAttribute dimensionAttribute;
DimensionAttributeDirCategory dimAttributeDirCategory;
Query query = new Query();
QueryBuildDataSource qbds;
SysTableLookup sysTableLookup;
dimensionAttribute = DimensionAttribute::findByName('Products');
if (dimensionAttribute.Type == DimensionAttributeType::CustomList)
{
select firstonly DirCategory from dimAttributeDirCategory
where dimAttributeDirCategory.DimensionAttribute == dimensionAttribute.RecId;
sysTableLookup = SysTableLookup::newParameters(tableNum(DimensionFinancialTag), this);
sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Value));
sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Description));
qbds = query.addDataSource(tableNum(DimensionFinancialTag));
qbds.addRange(fieldNum(DimensionFinancialTag, FinancialTagCategory)).value(queryValue(dimAttributeDirCategory.DirCategory));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
}
-----------------------------------------------------------------------------------------------------------
1.)create New Class...................
class NaSyslookup extends SysLookup
{
}
Public void lookupDimension(FormStringControl _stringControl, Name _dimensionName)
{
syslookup::lookupDimension(_stringControl,_dimensionName);
}
2.)write code in Lookup override...........................
public void lookup()
{
NaSyslookup cicsyslookup = new NaSyslookup();
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
SysTableLookup sysTableLookup = new SysTableLookup();
//super();
switch (TransType.selection())
{
case 0:
sysTableLookup = SysTableLookup::newParameters(tableNum(DimAttributeOMBusinessUnit), this);
queryBuildDataSource = query.addDataSource(tableNum(DimAttributeOMBusinessUnit));
sysTableLookup.addLookupfield(fieldNum(DimAttributeOMBusinessUnit, Value),true);
sysTableLookup.addLookupfield(fieldNum(DimAttributeOMBusinessUnit, Name));
sysTableLookup.addSelectionField(fieldNum(DimAttributeOMBusinessUnit, Value));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
break;
case 1:
sysTableLookup = SysTableLookup::newParameters(tableNum(DimAttributeOMDepartment), this);
queryBuildDataSource = query.addDataSource(tableNum(DimAttributeOMDepartment));
sysTableLookup.addLookupfield(fieldNum(DimAttributeOMDepartment, Value),true);
sysTableLookup.addLookupfield(fieldNum(DimAttributeOMDepartment, Name));
sysTableLookup.addSelectionField(fieldNum(DimAttributeOMDepartment, Value));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
break;
case 2:
sysTableLookup = SysTableLookup::newParameters(tableNum(DimensionFinancialTag), this);
queryBuildDataSource = query.addDataSource(tableNum(DimensionFinancialTag));
sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Value),true);
sysTableLookup.addLookupfield(fieldNum(DimensionFinancialTag, Description));
sysTableLookup.addSelectionField(fieldNum(DimensionFinancialTag, Value));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
break;
default:
}
}
No comments:
Post a Comment