Activity › Forums › Salesforce® Discussions › Salesforce Remote Action not working in JavaScript?
Tagged: Javascript, Javascript in Salesforce, Remote Action, RemoteAction, Salesforce Javascript Controller
-
Salesforce Remote Action not working in JavaScript?
Posted by Saurabh on April 26, 2018 at 4:26 PMRemote Action not working in JavaScript?
Avnish Yadav replied 7 years, 7 months ago 4 Members · 3 Replies -
3 Replies
-
Hi saurabh,
The problem is because you’re uploading the javaScript file via static resource, but all {!####} expressions are been compiled on page load and not in the static resource.You need to Add the remote action name as a hidden input field on the page, like this:
<input id=”remote_action” type=”hidden” value=”{!$RemoteAction.MSSPageController.updateHopscotch}”/>
And then fetch the value of the input by the Id and pass it to the remote manager.Thanks.
- [adinserter block='9']
-
Hi Saurabh,
Can you please share you code where you are using remote action in JavaScript. Without looking at the code no one tells what it is that causing the actual issue. It may be syntax error that prevent remote action from working.
Thanks
Log In to reply.