function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vino2vijayvino2vijay 

What is the use of Javascript Remoting ? when we need to use ?

Hi

can anyone pelase let me know below questions.

 

1. What is the use Javascript Remoting ?

 

2. If more flexible, When we need to use ?

 

3. What is the use of Actionfunction ?

 

4. What is the diffrenece between Actionfunction and Javascript remoting ?

 

5. JS remoting used for mainly calling the APEX method from javascript ? if yes what s the benefits ? can u please let me know real time scanerio ?

 

As of now, I know the js remoting the will be used for calling APEX method from javascript . i just want to know when we need to perform this ?

 

 

Thanks

Vinoth

Best Answer chosen by Admin (Salesforce Developers) 
bvramkumarbvramkumar

1. What is the use Javascript Remoting ?

 A) You can communicate with VF page's controller's methods without posting your form. Action Function posts the data.

 

2. If more flexible, When we need to use ?

A) JS remoting is not an alternate for Action function. There may arise a case in requirement to get/set some information or basically to perform an from controller without actually posting the form.

 

3. What is the use of Actionfunction ?

A) It posts data to to the controller. Unlike JS remoting you can rerender certain portions of your VF page. Because of this particual page rendering you can get refreshed values from server.

 

4. What is the diffrenece between Actionfunction and Javascript remoting ?

A)

i) Action function posts the form and JS Remoting does not

ii) Action function can do partial page rerendering which JS remoting can not.

 

5. JS remoting used for mainly calling the APEX method from javascript ? if yes what s the benefits ? can u please let me know real time scanerio ?

A)

i) Auto-complete search. for e.g. to list the articles titles while 

ii) Any scenario where you dont want to refresh the page/no partial page rendering and just want to perform an action.

iii) Any scenario where you need to repetitively call controller without a need to rerender.

iv) There is a possibility to avoid View-State issue when you use JS remoting because you will just give back the data to the user but not keep it on the server which mounts to View-State.

All Answers

bvramkumarbvramkumar

1. What is the use Javascript Remoting ?

 A) You can communicate with VF page's controller's methods without posting your form. Action Function posts the data.

 

2. If more flexible, When we need to use ?

A) JS remoting is not an alternate for Action function. There may arise a case in requirement to get/set some information or basically to perform an from controller without actually posting the form.

 

3. What is the use of Actionfunction ?

A) It posts data to to the controller. Unlike JS remoting you can rerender certain portions of your VF page. Because of this particual page rendering you can get refreshed values from server.

 

4. What is the diffrenece between Actionfunction and Javascript remoting ?

A)

i) Action function posts the form and JS Remoting does not

ii) Action function can do partial page rerendering which JS remoting can not.

 

5. JS remoting used for mainly calling the APEX method from javascript ? if yes what s the benefits ? can u please let me know real time scanerio ?

A)

i) Auto-complete search. for e.g. to list the articles titles while 

ii) Any scenario where you dont want to refresh the page/no partial page rendering and just want to perform an action.

iii) Any scenario where you need to repetitively call controller without a need to rerender.

iv) There is a possibility to avoid View-State issue when you use JS remoting because you will just give back the data to the user but not keep it on the server which mounts to View-State.

This was selected as the best answer
vino2vijayvino2vijay

You the man ....

 

Thanks Ram...

Arpit Sethi 9Arpit Sethi 9
Awesome explaination. Thanks a lot.
atla satheeshkumaratla satheeshkumar
great answer
Sakshi ChauhanSakshi Chauhan
awesome..bvramkumar first time I am able to understand JS usage..thanks
SAHG-SFDCSAHG-SFDC
Great Explanation!
ramarao pattabhiramarao pattabhi
nice answer
Sachin Verma 20Sachin Verma 20
very nice explanation
Arun Garg 9Arun Garg 9
Use of JavaScript Remoting on visualforce page using controller.
Go to this lik to know how to use remoting on page with DEMO.
https://sfdcadda.blogspot.in/2017/05/use-of-javascript-remoting-on.html