You need to sign in to do that
Don't have an account?
SFDC2 Admin2 7
javascript was working yesterday but now is not
Hello everyone,
So I had two buttons that were working fine up until yesterday and now both of them are coming back with the same exact error message. They both do the same thing, allow an attachment to a list of e-mail addresses while date stamping a value. Their last modified date was 5/16/2016 and now they are both not working. Here is my code, I haven't run any updates. I am also willing to change this button as long as the same things can be accomplished.
So I had two buttons that were working fine up until yesterday and now both of them are coming back with the same exact error message. They both do the same thing, allow an attachment to a list of e-mail addresses while date stamping a value. Their last modified date was 5/16/2016 and now they are both not working. Here is my code, I haven't run any updates. I am also willing to change this button as long as the same things can be accomplished.
{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")} location.replace('/email/author/emailauthor.jsp?retURL=/{!Opportunity.Id}&rtype=003&p24={!Opportunity.OwnerEmail}&p4=(___EMAIL ADDRESSES REMOVED PURPOSELY___)&template_id=239291302&p6={!Opportunity.Name}'); var oppObj = new sforce.SObject("Opportunity"); oppObj.Id = '{!Opportunity.Id}'; var build = new Date(); var month = build.getMonth(); var day = build.getDate(); var year = build.getFullYear(); var today = new Date(year,month,day); try { oppObj.CL2_Binder_Date__c = today; sforce.connection.update([oppObj]); } catch(e) { console.log(e.message); }
Azharuddin Khan
May be you try something called as debugging.
Edwin Vijay
What is the error message you get?
SFDC2 Admin2 7
I figured it out. It wasn't executing any code(so no debug logs, thanks Azharuddin Khan I think I know how to debug) since I'm doing a link replacement. I thought it was because ajax libraries got moved internally on the server, but it was much simpler than that... The opportunity name had an ' in it, so the link replacement code wasn't executing.