7.3 EWARE_TOP custom content

I have some custom content in the company header, this was added when we had version 7.1

With version 7.3 SP3.6 the content is not refreshed when changing the company. you have to manually refresh the page.

Is there a work around to automatically refresh the company top content?

Thanks

Ed

  • 0

    Ed

    How has it been added into the Top Content? Have you used the CompanyTopContent screen or are you coding to directly interact with the TopContent area?

  • 0

    Jeff,

    By using the CompanyTopContent screen

    function CTICall(country, area, phone)

    {

    if (country.length != 0){

    country = "+"+country

    }

    var number = ""+country+" ("+area+") "+phone

    if(phone != ""){

    if(SageCRM.wsCTI.showCti()){window.setTimeout(function(){SageCRM.wsCTI.dialOut(number);},500);}

    }

    }

    function SENDEmail(emailaddress, companyid, personid)

    {

    SageCRM.webMenu.MailTo(emailaddress,event,'&Key0=2&Key1='+companyid+'&Key2='+personid+'&Key24='+companyid+'');

    }

    var companyrecord = CRM.GetContextInfo("company","comp_companyid");

    var accountRecord = CRM.FindRecord("Account", "acc_companyid="+CRM.GetContextInfo("company","comp_companyid"));

    var userRecord = CRM.FindRecord("users","user_userid ="+CRM.GetContextInfo("company","comp_primaryuserid"));

    var personRecord = CRM.FindRecord("Person", "pers_personid ="+CRM.GetContextInfo("company", "comp_primarypersonid"));

    var phoneLink = CRM.FindRecord("PhoneLink", "PLink_Type = 'Business' and plink_entityid = 13 and PLink_RecordId ="+personRecord.Pers_PersonId);

    var PersonPhone = CRM.Findrecord("Phone", "Phon_PhoneId = "+phoneLink.PLink_LinkID);

    var EmailLink = CRM.FindRecord("EmailLink", "Elink_entityid = 13 and ELink_RecordId ="+personRecord.Pers_PersonId);

    var EmailRecord = CRM.FindRecord("Email", "Emai_emailId = "+EmailLink.ELink_LinkId);

    var userFirstName = ""+userRecord.user_firstname

    var userLastName = ""+userRecord.user_lastname

    if (userFirstName == 'undefined') userFirstName = '';

    if (userLastName == 'undefined') userLastName = '';

    var personFirstName = ""+personRecord.pers_firstname

    var personLastName = ""+personRecord.pers_lastname

    if (personFirstName == 'undefined') personFirstName = '';

    if (personLastName == 'undefined') personLastName = '';

    var personPhonecountry = ""+PersonPhone.Phon_CountryCode

    var personPhoneArea = ""+PersonPhone.Phon_AreaCode

    var personPhoneMain = ""+PersonPhone.Phon_Number

    if (personPhonecountry == 'undefined') personPhonecountry = '';

    if (personPhoneArea == 'undefined') personPhoneArea = '';

    if (personPhoneMain == 'undefined') personPhoneMain = '';

    var personPhoneFullno = +personPhonecountry+" "+personPhoneArea+" "+personPhoneMain

    var companywebsite = ""+comp_website

    if (companywebsite == 'undefined') companywebsite = '';

    var PersonEmail = ""+EmailRecord.Emai_EmailAddress

    if (PersonEmail == 'undefined') PersonEmail = '';

    var companyid = ""+companyrecord

    var personid = ""+personRecord.pers_personid

    Caption = "

    ";

    Caption +="Account Manager";

    Caption +=":

    ";

    Caption +=""+userFirstName+ " "+userLastName+"";

    Caption +="

    " ;

    Caption +="";

    Caption +="

    " ;

    Caption +="Main Contact";

    Caption +=":

    ";

    Caption +=""+personFirstName+ " "+personLastName+"";

    Caption +="

    ";

    Caption +="Sage A/C Number";

    Caption +=":

    ";

    Caption +=""+accountRecord.acc_reference+"";

    Caption +="

    " ;

    Caption +="";

    Caption +="

    " ;

    Caption +="Phone Number";

    Caption +=":

    ";

    Caption +=""+personPhoneFullno+"";

    Caption +="

    " ;

    Caption +="Payment Terms";

    Caption +=":

    ";

    Caption +=""+accountRecord.acc_payterms+"";

    Caption +="

    " ;

    Caption +="";

    Caption +="

    " ;

    Caption +="Contact Email";

    Caption +=":

    " ;

    Caption +=""+PersonEmail+"";

    Caption +="";

    Ed

  • 0

    So what is the smallest amount of code that will demonstrate the issue?

  • 0

    Anything dynamic

    var userRecord = CRM.FindRecord("users","user_userid ="+CRM.GetContextInfo("company","comp_primaryuserid"));

    var userFirstName = ""+userRecord.user_firstname

    var userLastName = ""+userRecord.user_lastname

    Caption +="Account Manager";

    Caption +=":

    ";

    Caption +=""+userFirstName+ " "+userLastName+"";

    Caption +="

    " ;

    Caption +="";

  • 0

    This is code added into a Create Script of a field?

    I need to be clear because the first example you gave included

    I only have Sage CRM 2018 on my machine but the a Create Script on a field contained in the Company TopContent will redraw as you change context.

  • 0

    Sorry Jeff,

    Yes the script goes into the create script.

    I am getting the feeling that this is a bug within the CRM version. I removed all the bespoke script and it still returned the wrong company in the CompanyTopContent.

    This seems to happen infrequently however after browsing through a few companies it gets more frequent!

    Ed

  • 0

    Ed

    It may be worth you asking the support team to see whether this is a known issue with Sage CRM 7.3.

  • 0

    Thanks Jeff, Will come back if no bug or they can't replicate.