Monday, August 28, 2017

Adding Query range in Multiple lookup in ax 2012

//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));
        }
    }
}

No comments:

Post a Comment

Convert Call stack to readable format in D365FO X++

//Input --container _xppCallStack = xSession::xppCallStack();  Public static str POL_formatXppCallStack(container _xppCallStack, int _skipFr...