Thursday, June 30, 2011

Calling Controller method From JavaScript in Salesforce

Hello,

There are often issues in calling controller class methods from javascript.
Here is a 3 step process.

1) Create a method in Controller class that returns PageReference





2) Create a method in Javascript from where you have to call the controller class method.

For this you have to create a Apex function (say uploadFiles).This acts as a bridge between the two methods




3) Now call this apex function from javascript method which will call your controller class method





Its Done...

Pass Values between SalesForce Pages


Hello,

Many a times we are in a situation when we want to pass values between the Apex pages.
Here is a 4 step process to do it.

Step 1 : Create a link label on the click of which you redirect the user to different page and pass values to it.



Step 2 : When u click on the link label and you are redirected to another page u can see the url which has the parameter appended to it



Step 3 : How to fetch value from the url


Step 4 : How to display the received value on the page



Enjoy SalesForcing....
:)

Display Custom Page on Custom Tab click in Salesforce

Finally i found it.

SalesForce Default Behavior
: When i click on any custom tab created by me in any salesforce application then by default it redirects to the standard salesforce page displaying the recent information.

What i wanted : I wanted to display a Custom visualforce page when user clicks on the custom tab.

How i did it
:








Enjoy Salesforce
Hope it helps...