Friday, February 17, 2023

Mask value in D365FO X++

 public str mask(str _element)

    {

        str result;

int maskLength = 8;

int elementLength = strLen(_element);

            int elementLenghtWillBeMasked = elementLength - maskLength;

            str elementValueKept = strDel(_element, 0, elementLenghtWillBeMasked);

            str elementValueMasked;


            while (elementLenghtWillBeMasked > 0)

            {

                elementValueMasked = elementValueMasked + 'X';

                elementLenghtWillBeMasked--;

            }


            result = elementValueMasked + elementValueKept;


        return result;

    }

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