Friday, February 17, 2023

logicalOperator (OR -> || or AND -> &&) Can set dynamic value at runtime in D365FO X++

 public static str logicalOperator(List _expressionList, str _operator)

    {

        str rangeExpression = '';

        int counter;


        ListEnumerator listEnumerator = _expressionList.getEnumerator();


        while (listEnumerator.moveNext())

        {

            counter++;


            if (counter != _expressionList.elements())

            {

                rangeExpression += '(' + listEnumerator.current() + ') ' + _operator + ' ';

            }

            else

            {

                // Last element

                rangeExpression += '(' + listEnumerator.current() + ')';

            }

        }


        return rangeExpression;

    }

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...