I’m trying to do something that should be very basic in SalseForce. I just need a button to run a small piece of javascript. It’s throwing the following error at the moment “Invalid assignment left hand side error”. Any help would be greatly appreciated.
if ( {!Contact.MailingPostalCode} = 'SC') {window.open('http://www.google.com','mywindow'); }
if ( {!Contact.MailingPostalCode} = 'FL') {window.open('http://www.yahoo.com','mywindow');
}
Thanks
Your
=needs to be==. You are assigning and what you want to do is compare.EDIT: Also, your ‘not’,
!, may need to be on the outside. I’m not familiar with the SalesForce side.EDIT 2: Try it this way:
TESTING:
EDIT 3:
For completeness, @Zach Colon’s code is: