NotifyNow - convertLocalPhoneNumberToE164(String userID, String phoneNumber)

Convert a local phone number to an E.164-compliant phone number based on a user's location.

Table 1. Parameters
Name Type Description
userID String The sys_id of a sys_user record to get location information from.
phoneNumber String The phone number.
Table 2. Returns
Type Description
String The E.164-compliant phone number.

var localPhoneNumber = '01784 221600';
var userName = 'Heath Vanalphen';
 
var user = new GlideRecord('sys_user');
user.get('name',userName);
var E164Number = new SNC.NotifyNow().convertLocalPhoneNumberToE164(user.getUniqueValue(), localPhoneNumber);
gs.log('converted: ' + localPhoneNumber + ' to ' + E164Number + ' based on ' + user.getValue('name') + 
     '\'s location (' + user.getValue('location') + ')');