-
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
To Lead or not to Lead, that is the question! | Salesforce Guide
Back when things were normal and we were able to go on-site and talk with our clients, there were a significant number of them who…
Retail Banking Powered by Salesforce
Background Salesforce has been around for a while, but in recent years we’re seeing a boom in its popularity. Why is that the case? The…
Interactive Quotes in Salesforce: What They Are and the Benefits for Your Business
As selling becomes more complex, reps need more time to connect with customers. Research shows that only 28% of sales reps spend their week selling. The…
Popular Salesforce Videos
Salesforce Developer Training Videos For Beginners | Salesforce Training Videos | Edureka
This Salesforce developer training video will give you an introduction to the development aspects of Salesforce. You will learn how Visualforce pages are created by…
Segments of Salesforce Data Cloud
In this extract, Shrey and Vishwajeet break down the different segments of the Salesforce Data Cloud and explain how they can help businesses of all…
Uncomplicating Sales with Salesforce CPQ
Sales representatives spend 34 percent of their time doing actual sales, while a staggering 66 percent of their time generating quotations, ideas, and gaining approvals,…

