look up - restrict duplicates and null values
public static void lookupGroupDimension(FormStringControl _dimensionFocusControl)
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
SysTableLookup sysTableLookup;
sysTableLookup = SysTableLookup::newParameters(tableNum(DimensionAttributeValue),_dimensionFocusControl);
sysTableLookup.addLookupfield(fieldNum(DimensionAttributeValue,GroupDimension));
queryBuildDataSource = query.addDataSource(tableNum(DimensionAttributeValue));
queryBuildDataSource.orderMode(OrderMode::GroupBy);
queryBuildDataSource.addGroupByField(fieldNum(DimensionAttributeValue, GroupDimension));
queryBuildRange = queryBuildDataSource.addRange(fieldNum(DimensionAttributeValue, GroupDimension));
queryBuildRange.value(SysQuery::valueNotEmptyString());
sysTableLookup.parmQuery(query);
sysTableLookup.parmUseLookupValue(true);
sysTableLookup.performFormLookup();
}
public static void lookupGroupDimension(FormStringControl _dimensionFocusControl)
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
SysTableLookup sysTableLookup;
sysTableLookup = SysTableLookup::newParameters(tableNum(DimensionAttributeValue),_dimensionFocusControl);
sysTableLookup.addLookupfield(fieldNum(DimensionAttributeValue,GroupDimension));
queryBuildDataSource = query.addDataSource(tableNum(DimensionAttributeValue));
queryBuildDataSource.orderMode(OrderMode::GroupBy);
queryBuildDataSource.addGroupByField(fieldNum(DimensionAttributeValue, GroupDimension));
queryBuildRange = queryBuildDataSource.addRange(fieldNum(DimensionAttributeValue, GroupDimension));
queryBuildRange.value(SysQuery::valueNotEmptyString());
sysTableLookup.parmQuery(query);
sysTableLookup.parmUseLookupValue(true);
sysTableLookup.performFormLookup();
}
No comments:
Post a Comment