noeticpenguin / ngForce

Force.com && Angular.js integration framework.
noeticpenguin.github.io/ngForce
MIT License
142 stars 61 forks source link

VF Remoting - How to pass values? #43

Closed btkarthick closed 8 years ago

btkarthick commented 8 years ago

Hi, I am a frond end developer and not a SalesForce guy. I having been using this plugin for a recent SF project and its awesome. But, i am facing one problem currently.

I am using 'vfr.send' method for calling RemoteAction methods. I have no problem in the 'GET'(or select) method. But, during 'POST' i don't know how to pass value to the RemoteAction method.

Tried passing value in the options like vfr.send( Controller.methodName, { name : 'Jhon' }, false );

But, this is not working.

Can someone point in right direction by tell how to pass values from JavaScript or how the SF remote method should be written to get the value?

Thank you.

davehahn commented 8 years ago

I have used it as follows:

var putMethod = vfr.send('Controller.methodName', {escape: false, timeout: 10000}, false);

putMethod( {name: 'John'} ).then(function( returnValue ) {
   /* returnValue will be what ever is returned from the controller method */
   ........
});

Hope this helps;

btkarthick commented 8 years ago

@davehahn , That's worked like a charm.

You are a life saver. Thanks a ton.

I am closing this issue.