You need to sign in to do that
Don't have an account?
Possible to call a javascript function from scheduled apex?
Have a working javascript button. Now I'd like to avoid pushing it :)
So I've utilized the other suggestions I've found and embedded my script in a VF page, but having trouble making the class "schedulable":
Error: Compile Error: Variable does not exist: callfunc at line 14 column 9
Thanks for any assistance,
Pete
So I've utilized the other suggestions I've found and embedded my script in a VF page, but having trouble making the class "schedulable":
global class calljavascript_cls implements Schedulable { global string callfunc{get;set;} global void execute(SchedulableContext sc) { calljavascript_cls(); } @future(callout=true) public static void calljavascript_cls() { callfunc='<script> func(); </script>'; } }
Error: Compile Error: Variable does not exist: callfunc at line 14 column 9
Thanks for any assistance,
Pete
All Answers
The property String callfunc is referenced by Visualforce Page (Javascript_VFpage) in salesforce.com. Remove the usage and try again. at line 3 column 19
Any other ideas?
Here's what interesting - if the VF page is first (verbatim, as above), you get the error I encountered when setting the callfunc global string variable to 'static'. If you comment out the <outputText> block in the VF page, then change the variable, then restore the <outputText> block in the VF page - all is well :) Odd behavior.
Thanks again!
https://developer.salesforce.com/forums/ForumsMain?id=9060G0000005rqG#!/feedtype=SINGLE_QUESTION_DETAIL&dc=Developer_Forums&criteria=OPENQUESTIONS&id=9060G0000005s1xQAA