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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
5 | |
5 | |
4 | |
4 | |
4 | |
4 | |
4 | |
3 | |
3 |