Sage/argos-sdk

2.0 Mobility - unable to enter phone number using alpha characters

rjledger opened this issue · 1 comments

Moved here from argos-SalesLogix:

Windows/LAN and web allow you to enter using alpha characters and then "translates" it into a number:
ex: 800GOVALLEY or 800FOXBORO
Mobility just "falls over" and tosses the characters so you end up with just "800" and nothing else.

This is how I changed the phone format in argos-saleslogix:

phoneLettersMap: [
            {
                test: /[ABC]/g,
                val: '2'
            },{
                test: /[DEF]/g,
                val: '3'
            },{
                test: /[GHI]/g,
                val: '4'
            },{
                test: /[JKL]/g,
                val: '5'
            },{
                test: /[MNO]/g,
                val: '6'
            },{
                test: /[PQRS]/g,
                val: '7'
            },{
                test: /[TUV]/g,
                val: '8'
            },{
                test: /[WXYZ]/g,
                val: '9'
            }
        ]

Before the clean regex runs:

var alphaMap = Mobile.SalesLogix.Format.phoneLettersMap;

for (var j = 0; j < alphaMap.length; j++) {
    val = val.replace(alphaMap[j].test, alphaMap[j].val);
}