• Ponram K
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hi all,

Our project demands to hide fields in some layout by using Home Page component.so I initially used Javascript in Home Page Component for achieve our requirement.But after upgradation of salesforce, components that contain JavaScript, CSS, iframes are restricted and stop working properly.I am attaching my code which i done before salesforce up-gradation.

Could anyone give solution for this? It would be great.



Code which work fine before SF upgradation:-

//Below If condition to hide the Service details in maintenance sheet  Edit Layout for system type: Disabled/Nursecall Alarm
if (document.location.href.toString().indexOf("/a0F") != -1 && document.location.href.toString().indexOf("/a0F/o") == -1 && document.location.href.toString().indexOf

("/e?") != -1 ) { 
//checking the system name
var e  = document.getElementById("00ND0000005Ec8j");
var strUser = e.options[e.selectedIndex].value;
//alert('Systm name '+strUser);

if(strUser != "Disabled/Nursecall")
{

for(var i=1;i<document.getElementsByTagName('Label').length;i++)
{
if(document.getElementsByTagName('Label')[i].innerHTML== "SLA Power Calibration Qty")
{
var a =document.getElementsByTagName('LABEL')[i].htmlFor;
document.getElementsByTagName('LABEL')[i].innerHTML ="";
document.getElementById(a).style.display='none';
}
}
}
}