Hi I am getting this error

Chrome - 'Unexpected token {'

Mozilla - 'missing ; before statement'

when clicking on a button, couldn't understand where I am going wrong. Please review my code below and guide me accordingly.


var CamId = '{!JSENCODE(Campaign.Id)}';

var result = sforce.apex.execute("CrtWlcomCallCampaign","welcomeCalls",{parentId:CamId});

alert{'Welcome call campaign is initiated'}; 

here method welcomeCalls returns void.

Thanks in advance.


Instead of this:

alert{'Welcome call campaign is initiated'};

you need:

alert('Welcome call campaign is initiated');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.