//Adding Query range in Multiple lookup in ax 2012
public void addRangeMultipleValue(tableId _table, fieldId _field, Query _query,str _delimitedMultipleValues)
{
List list;
ListEnumerator items;
str currentItem;
list = new List(Types::String);
if (_delimitedMultipleValues != strMin())
{
list = strSplit(_delimitedMultipleValues, #ExpressionDelimiter);
items = list.getEnumerator();
while (items.moveNext())
{
currentItem = items.current();
if (currentItem != strMin())
{
this.addSearchCriteriaString(_table, _field, _query,currentItem, true);
}
}
}
}
public void addSearchCriteriaString(tableId _tableId, fieldId _fieldId, str _attributeValue,Query _query,boolean _like = true)
{
QueryBuildDataSource qbds;
QueryBuildRange qbr;
qbds = query.dataSourceTable(_tableId);
if (qbds != null)
{
qbr = qbds.addRange(_fieldId);
if (_like)
{
qbr.value(SysQuery::valueLike(_attributeValue));
}
else
{
qbr.value(SysQuery::value(_attributeValue));
}
}
}
public void addRangeMultipleValue(tableId _table, fieldId _field, Query _query,str _delimitedMultipleValues)
{
List list;
ListEnumerator items;
str currentItem;
list = new List(Types::String);
if (_delimitedMultipleValues != strMin())
{
list = strSplit(_delimitedMultipleValues, #ExpressionDelimiter);
items = list.getEnumerator();
while (items.moveNext())
{
currentItem = items.current();
if (currentItem != strMin())
{
this.addSearchCriteriaString(_table, _field, _query,currentItem, true);
}
}
}
}
public void addSearchCriteriaString(tableId _tableId, fieldId _fieldId, str _attributeValue,Query _query,boolean _like = true)
{
QueryBuildDataSource qbds;
QueryBuildRange qbr;
qbds = query.dataSourceTable(_tableId);
if (qbds != null)
{
qbr = qbds.addRange(_fieldId);
if (_like)
{
qbr.value(SysQuery::valueLike(_attributeValue));
}
else
{
qbr.value(SysQuery::value(_attributeValue));
}
}
}
No comments:
Post a Comment