-
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
5 Strategies to Master Salesforce User Adoption: Pre-Launch
An efficient CRM system automates most of the processes through the customer life cycle. It helps retain the customer's trust in every stage of their…
An Introduction to Salesforce Force.com Migration Tool (ANT)
Let’s understand Metadata as: Data which give information about other Data. Metadata sums up essential data about information, making discovering, and working with specific examples…
Popular Salesforce Videos
What is the Future of Salesforce Developer?
Salesforce Developer jobs are on the rise. A lot of MNC companies like TCS, Infosys, Cognizant, etc are hiring Salesforce developers. In this video, Musings…
How To Create a Dashboard in Salesforce CRM Analytics (Tableau CRM) From Scratch | Part 1 - Dataset
Salesforce CRM Analytics (formerly Tableau CRM) is a powerful tool for data analysis and visualization. The foundation of any CRM Analytics dashboard is a dataset.…
Salesforce Lightning Process Builder: Lightning Process Builder Basics
The Salesforce Lightning Process Builder is a new workflow tool that helps anyone in your company quickly and easily automate business processes such as employee…

