How to create auto formatting Phone number in SuiteCRM ? Thanks
example. 111-222-2222
How to create auto formatting Phone number in SuiteCRM ? Thanks
example. 111-222-2222
Step 1. Create file inside directory
/custom/clients/base/field/phone/phone.js
step 2.
({
extendsFrom:“PhoneField”,
initialize:function(options)
{
this.super(“initialize”,[options]);
},
format:function(value)
{
if((this.action===‘list’||this.action===‘detail’||this.action===‘record’)&&this.isSkypeFormatted(value)&&this.skypeEnabled)
{
this.skypeValue=this.skypeFormat(value);
}
if(!.isEmpty(value)){if(value.length>=10){if(value.indexOf(’-’)==-1)
{
//put here your country phone format this is US format
value=’+1’+’(’+value.substr(0,3)+’)’+’-’+value.substr(3,3)+’-’+value.substr(6,4);
}}}
return value;
}
})
hope this helps.
Ohh thanks i’ll try later THANK YOU
how can I put that code in Create Lead?
i create phone number field in Create Lead.