I have a check in apex page with javascript code as below under script tags.
var proli ="{! $Profile.Name }";
//alert(proli);
if(proli=='Abbott DM' || proli=='Field Profile' )
{
alert('{!$Profile.Name} not authorized to publish');
var isok =alert('{!$Profile.Name} not authorized to publish- Click OK to go back');
var a;
a = setTimeout('window.location.href="/a4M?fcf=00BM0000000tpnc";',1);
}
I need the if clause above to check proli!='Abbott DM'
. But it is not working. Can someone please let me know how to get that?
proli
depends on the time this snippet get executed – highfive Sep 14 '15 at 12:08alert(proli+'not authorized to publish');
? – highfive Sep 14 '15 at 12:15