Skip to Content
Author's profile photo Anderson Balieiro

Apply Masks in Extended field

You can write logic in your Event BeforeSave in your extend field in XBO.

Mask Telephone

       var CurrentTelephone = this.CurrentDefaultAddressInformation.Address.DefaultConventionalPhone.FormattedNumberDescription;

       var tel_check = CurrentTelephone.Contains(“-“);

       if (tel_check == false){

             var ddd = CurrentTelephone.Substring(4,2);

             var pretelephone = CurrentTelephone.Substring(6,4);

             var suftelephone = CurrentTelephone.Substring(10,4);

             var formatTelephone = ddd + ” “ + pretelephone + “-“ + suftelephone;

              this.CurrentDefaultAddressInformation.Address.DefaultConventionalPhone.FormattedNumberDescription = formatTelephone;   

       }

Mask PostalCode

       var CurrentpostalCode = this.CurrentDefaultAddressInformation.Address.DefaultPostalAddressRepresentation.StreetPostalCode;

       var posicao = CurrentpostalCode.Contains(“-“);

       if (posicao == false) {

             var prefixPostalCode = CurrentpostalCode.Substring(0,5);

             var sufixPostalCode  = CurrentpostalCode.Substring(5,3);

             var postalCode = prefixPostalCode + “-“ + sufixPostalCode;

              this.CurrentDefaultAddressInformation.Address.DefaultPostalAddressRepresentation.StreetPostalCode = postalCode

       }

This document was generated from the following discussion: Apply Masks in Extended field

Assigned tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.