Sage CRM 7.2 - Hide Phone and replace with Mobile Number on Person top content screen

Hi,

Anyone know how to hide "Phone" (in red square) and replace with "Mobile Number" (in green square) from Person top content screen.

I can manage to put mobile number on screen but how to hide "Phone"? I did some research and found that someone mentioned to use Client side API. However, I found 'hide" command from Client side API doc but they need to use field name and those 2 fields, "Phone" and "Mobile Number", using the same database fields so how can I achieve this?

Thank you very much in advance.

Regards,

Chayaporn

  • 0

    Hi Chayaporn

    By default Sage CRM displays basic fields on Person Top Content e.g. Person Name, Company Name, Phone, Email etc. Apart from this if you want to add any fields then you can do the same using Person Top Content screen. Now as per your above post you want to replace Phone number field with Mobile Number. You can implement this change in CRM through Client Side Scripting. Kindly Refer the below given steps for your reference.

    1. Create New Person.js file and deploy the same under CustomPages folder
    2. Create Client Side Script code to call Person.js file in CRM
    3. Create new function in Person.js file to replace Phone number field with Mobile Number
    4. You can find Phone Details using “TOPCAPTION” and “TOPSUBHEADING “ class name
    5. Using above mentioned class name you can replace Phone number field with Mobile Number

    Hope this helps!

    Regards,

    Dinesh

  • 0

    Hi Dinesh,

    Thank you for your reply.

    Would you please provide sample code in Person.js file?

    Really appreciate your help.

    Thank you.

    Regards,

    Chayaporn

  • 0

    Hi Chayaporn,

    Kindly follow the below given steps for your reference.

    1.Please added below given Script code in Person.js file

    function OnPageLoad()
    {
    changeTopContent();
    }
    function changeTopContent()
    {
    var PhonenNumber="";
    var MobileNumber="";
    if(document.getElementById("hdnPhone"))
    PhonenNumber=document.getElementById("hdnPhone").value;

    if(document.getElementById("hdnMobile"))
    MobileNumber=document.getElementById("hdnMobile").value;

    for(i=0;i
    {
    if(document.all[i].className=="TOPBODY")
    {
    var HTML=document.all[i].outerHTML
    if(document.all[i].outerHTML.search("Phone:")>-1)
    {

    HTML=HTML.replace("Phone:","Mobile Number:");
    HTML=HTML.replace(PhonenNumber,MobileNumber);
    document.all[i].outerHTML=HTML;

    }
    }

    }
    }
    2.Login into Sage CRM
    3.Go to Administration || Customization || Person || Screen
    4.Click on PersonBoxLong hyperlink
    5.Select First Name from list
    6.Enter below given code in Create Script Box

    var Personid=new String(eWare.GetContextInfo("person","Pers_PersonId"))
    if(Personid=="" || Personid=="null" || Personid=="undefined")Personid=0;
    //' Get Phone Number
    var sPhone="";
    var SQLPhone=" select (LTRIM(RTRIM(Phon_CountryCode))+' '+ LTRIM(RTRIM(Phon_AreaCode))+' '+ LTRIM(RTRIM(Phon_Number))) As Phone from phone(nolock) ";
    SQLPhone+=" left outer join PhoneLink (nolock) on PLink_PhoneId=Phon_PhoneId "
    SQLPhone+=" where PLink_Type='Business' and PLink_EntityID=13 and PLink_RecordID='"+Personid+"' and PLink_Deleted is null and Phon_Deleted is null ";
    sPhoneRec=eWare.CreateQueryObj(SQLPhone);
    sPhoneRec.SelectSQL();
    if(!sPhoneRec.eof)
    {
    sPhone=new String(sPhoneRec("Phone"));
    if(sPhone=="" || sPhone=="null" || sPhone=="undefined")sPhone=0;
    }

    //' Get Mobile Number
    var sMobile="";
    var SQLMobile=" select (LTRIM(RTRIM(Phon_CountryCode))+' '+ LTRIM(RTRIM(Phon_AreaCode))+' '+ LTRIM(RTRIM(Phon_Number))) As Mobile from phone(nolock) ";
    SQLMobile+=" left outer join PhoneLink (nolock) on PLink_PhoneId=Phon_PhoneId "
    SQLMobile+=" where PLink_Type='Mobile' and PLink_EntityID=13 and PLink_RecordID='"+Personid+"' and PLink_Deleted is null and Phon_Deleted is null ";
    sMobileRec=eWare.CreateQueryObj(SQLMobile);
    sMobileRec.SelectSQL();
    if(!sMobileRec.eof)
    {
    sMobile=new String(sMobileRec("Mobile"));
    if(sMobile=="" || sMobile=="null" || sMobile=="undefined")sMobile=0;
    }

    Caption="First Name:";
    7.Click on Update and Save button.

    Hope this helps!

    Regards,
    Dinesh