You need to sign in to do that
Don't have an account?
Alx Mr
javasript to call the apex function
I'm not able to call an apex function that checks if attahcment was added from JavaScript.
This is wat i have:
Js:
Do i still miss anything?
Thank you very much.
This is wat i have:
Js:
window.addEventListener("beforeunload", function(){CheckAttachment();}); // onbeforeunload = CheckAttachment; function CheckAttachment(){NoAttch();}VF
<apex:form id="TheForm"> <apex:actionFunction name="NoAttch" action="{!NoAttachmentEmail}"/>Controller:
public controllerInfo(){ isattch = false; altid = false; ....Function:
public void NoAttachmentEmail(){ if (isAttch==false && altId == false){ .....} }
Do i still miss anything?
Thank you very much.
1) https://developer.salesforce.com/forums/?id=906F00000008zaMIAQ
2) http://salesforce.stackexchange.com/questions/4910/calling-a-apex-controller-method-using-javascript-in-vf-page
This is helpful.
However, I need to run function on beforeunload, and I do not manage to have it working.