Can anyone help me with the syntax for using a custom label in a Javascript button. Essentially, I am trying to direct users to different pages based upon whether the Opportunity Record Type contains the 15 character ID string contained in a custom label. My code is below:
if('{CONTAINS(Opportunity.RecordTypeId,$Label.ENT_CommitRT_ID)}' == 'TRUE'){
window.open('/apex/opportunityProductEntry_Exclusive?id={!Opportunity.Id}')
}
else{
window.open('/p/opp/SelectSearch?addTo={!Opportunity.Id}&retURL=%2F{!Opportunity.Id}')
}
The problem is that no matter what record type the Opp has, it always defaults to else condition.