I am trying to get the profile and username in JavaScript button but I am getting an error when trying to click on the button
{!REQUIRESCRIPT("/soap/ajax/36.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/24.0/apex.js")}
var currentuser = sforce.connection.getUserInfo();
if('{!Contract_Approval_Form__c.Approval_Status__c}' == 'Approved')
{
alert('{!$Profile.Name}')
if('{!$User.Id}' == '005E00000088akt')
{
window.open("/apex/echosign_dev1__AgreementTemplateProcess?masterid={!Contract_Approval_Form__c.Id}&templateId=aH0V0000000CcVSKA0 ","_self");
}else if('{!$User.Id}' == '005E0000001noF2IAI')
{
window.open("/apex/echosign_dev1__AgreementTemplateProcess?masterid={!Contract_Approval_Form__c.Id}&templateId=aH0V00000008PXg ","_self");
}else if('{!$Profile.Id}' == '00eE0000000eOCd')
{
window.open("/apex/echosign_dev1__AgreementTemplateProcess?masterid=
{!Contract_Approval_Form__c.Id}&templateId=aH0V00000008PXl ","_self");
}
}else
{
window.alert("Please make sure Approval Status to be Approved");
}
When ever I add else if('{!$Profile.Id}' == '00eE0000000eOCd')
condition , button is failing .Can you please let me know what I am missing