-
Sample code for option button on VF page and getting value in apex class
Hi
I need to built a page with say two or more fields - their values will be Yes or No - based on if it is selected or not.
Get these field values in class and based on field values set variable values and call the function e.g:
VF Page:
Text1: Yes(it is a radio button)
Text2: Yes(radio)
call saveList from action button on VF page.
Apex Class:
Public String Cat
Public String Req
public PageReference saveList()
{if(Text1 == Yes):
Cat = 'abc'
Req = 'abc'
CallFunction(Cat,Req)
}
if(Text2 == 'Yes'){
Cat = 'def'
Req = 'def'
CallFunction(Cat,Req)
}
}
public void CallFuntion(String Cat, String Req)
{
statements;
}
Log In to reply.
Popular Salesforce Blogs
The Importance of Salesforce AppExchange for Business Growth | Salesforce AppExchange
Salesforce.com's revolutionary cloud computing marketplace, Salesforce AppExchange, allows businesses to access and install software to meet their specific needs. It was launched in 2005 and is…
How Salesforce IoT Cloud Prove to be Beneficial for Your Business
The term, Internet of Things (IoT), is a system of connected computing devices, such as mobiles, digital machines, and other objects with the potential of…
Popular Salesforce Videos
How Will Salesforce Career Look Like 3 Years From Now?
In this video, Shrey shares his opinions about How will Salesforce career look like 3 years from now. Watch and learn. If you have any…
Algoworks Is Now A Salesforce Summit (Platinum) Partner | Salesforce Consulting Services
It's been just a year since we became Salesforce gold consulting partners. Algoworks has now been recognized as a Salesforce Summit Partner (also known as…
How to Enable the New Pardot Email Builder | Salesforce Pardot
Learn how to set up the new Email Builder for Pardot and set up Salesforce CMS for email content storage. Watch this video and do…

