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

Search hierarchy for a match (TableALLGroup) X++

  Table1 ppt;  select firstonly ppt  order ItemCode, ItemRelation, AccountCode, AccountRelation where      (ppt.ItemCode == TableGroupAll::T...