You need to sign in to do that
Don't have an account?
sujin h s
Uncaught ReferenceError to action function
Hi all,
I'm trying to display a popup only once based on stage of the opportunity.
So I'm trying to update a field on showing popup once using the below code.
vf page:
On calling actfun() its giving following error:
Uncaught ReferenceError: actfun is not defined
Can anyone let me know what is the issue?
Thanks in advance!
Regards,
Sujin.
I'm trying to display a popup only once based on stage of the opportunity.
So I'm trying to update a field on showing popup once using the below code.
vf page:
<apex:page standardController="Opportunity" extensions="displayAlert"> <apex:form> <apex:outputpanel rendered="{!IF(Opportunity.Status__c='Closed_Won'&& Opportunity.Pop_Up_Shown__c=False,True,False)}"> <script> { console.log("Loaded"); alert("My custom message!"); actfun(); } </script> </apex:outputpanel> <apex:actionfunction name="actfun" action="{!UpdatePopupShown}"/> </apex:form> </apex:page>Controller:
public class displayAlert { ApexPages.StandardController controller; public displayAlert (ApexPages.StandardController controller) { this.controller = controller; } public void UpdatePopupShown() { Opportunity m = (Opportunity)controller.getRecord(); m.Pop_Up_Shown__c = true; update m; } }
On calling actfun() its giving following error:
Uncaught ReferenceError: actfun is not defined
Can anyone let me know what is the issue?
Thanks in advance!
Regards,
Sujin.
Your issue seems similar to https://salesforce.stackexchange.com/questions/145493/uncaught-referenceerror-callaf-is-not-defined. Does it help fix the error in your case ?Thanks
This is not working for me! Still the same error.