-
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
Salesforce Implementation: In House vs Outsource
Introduction Salesforce is the leading cloud-based customer relationship management solution in the world, and it enables organizations to monitor and connect with current and potential…
Tips To Improve Workflow Automation For Your Business
In a fast-paced world where businesses have an increasing need to improve their efficiency and reduce bottlenecks to keep up with the competitive landscape, automation…
Essentials Question To Gauge Digital Transformation Of An Organization | Salesforce Guide
In an internet-driven world that demands an online presence to stay in tune with the evolving marketplace, every industry needs to keep up with the…
Popular Salesforce Videos
5 Tips on How to Run Your Pipeline Engine to Drive Growth | Salesforce on Salesforce
Salesforce’s revenue has been on a firm upward trajectory for years, and every year we see terrific growth. How do we do it? I’ll let…
How to Transform Sales Processes with Salesforce Anywhere
Salesforce Anywhere – a real-time interface that extends the power of Salesforce – is here to give sales leaders more visibility into what’s going on…
Salesforce training video for beginners
Salesforce is an innovative tool that can be very powerful when used properly. That’s why it’s important to find effective and trustworthy ways to learn…