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

Copy Markup charges while posting purchase invoice using X++

 Copy Markup charges while posting purchase invoice using X++ Class: Important: Code logic is just for Reference.  New class => Duplicate...