Hi,
Please modified following Javascript for your request.
function commonEventHandler(executionContext){
var formContext=executionContext.getFormContext():
var telephoneAttr=formContext.data.entity.attributes.getByName('telephone1');
var isNumberWithCountryCode=telephoneAttr.getValue().substring(0,1) === '+';
//telephone field will be a from control if invoked from a form onChange event
//telephone field will be editable grid Gridcell object if invoked from editable grid OnChange event
var telephoneField=telephoneAttr.controls.getByIndex(0);
if(!isNumberWithCountryCode){
telephoneField.setNotification('Please include the country code beginning with '+'.','countryCodeNotification');
}
else{
telephoneField.clearNotification('countryCodeNotification');
}
}
function commonEventHandler(executionContext) {
var formContext = executionContext.getFormContext();
var telephoneAttr = formContext.data.entity.attributes.getByName('telephone1');
var isNumberWithCountryCode = telephoneAttr.getValue().substring(0,1) === '+';
// telephoneField will be a form control if invoked from a form OnChange event;
// telephoneField will be a editable grid GridCell object if invoked from editable grid OnChange event.
var telephoneField = telephoneAttr.controls.getByIndex(0);
if (!isNumberWithCountryCode) {
telephoneField.setNotification('Please include the country code beginning with ‘+’.', 'countryCodeNotification');
}
else {
telephoneField.clearNotification('countryCodeNotification');
}
}