+ Start a Discussion
shravani milshravani mil 

Java script to call function

shravani mil 
javascript to call method from apex and visualforce page
I have created this page. 
VF Page n class below:  
•         List
•         List_Controller

When I click on the links under C#, it should navigate to the respective Config page. by using Javascript to navigate to the respective pages.

Exp: If I click on C-1 ..it should navigate to the below link. 

C-1  https://na2.salesforce.com.visual.force.com/apex/page_VF?salesrep=9iouyu555689
C-2 https://na2.salesforce.com.visual.force.com/apex/page_VF?salesrep=0854897778hhhj
Ravi Dutt SharmaRavi Dutt Sharma
Hi Shravani,

You can use apex:outputLink to achieve this functionality:
 
<apex:outputLink value="https://na2.salesforce.com.visual.force.com/apex/page_VF?salesrep=9iouyu555689">C1</apex:outputLink>

<apex:outputLink value="https://na2.salesforce.com.visual.force.com/apex/page_VF?salesrep=0854897778hhhj">C2</apex:outputLink>

Let me know if this helps you. Thanks.

 
shravani milshravani mil
Hi Ravi we have different numbers up to 100 etc so do we need to specify each and every output link?
Ravi Dutt SharmaRavi Dutt Sharma
Yes, you need to specify output link for every number. Instead of hardcoding the value attribute in page itself, you can store all the values in custom setting, then retrieve the value of custom setting in apex controller and use the value on page.

You can find more information about custom settings here : https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_custom_settings.htm