I am trying to delete the related records on click of a button which is working fine.Now i want the delete logic to work only the profiles which contains 'xyz' in their name. I am getting an error 'TypeError: System Admin.contains not a function'.
Any other methods which i can use here.
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}
alert('{!$Profile.Name}')
try{
if('{!$Profile.Name}'.contains('xyz')){
if('{!$Profile.Name}'.contains('pss')){
withif(String.valueOf({!$Profile.Name}).contains('pss')){
orif((String){!$Profile.Name}.contains('pss')){
. Maybe the profile name needs to be typecasted as a String, although I'd expect it to be retrieved as a String so this is just a guess.