-
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 Productivity Tips by Salesforce System Administrators
Salesforce is a highly transformative platform when used correctly. It has all the tools you need to build and optimize processes. But achieving productivity on…
Lightning Web Component | Salesforce Developer Guide
Lightning Web Component Presently you'll construct Lightning components utilizing two programming models: Lightning Web Components and the first demonstrate, Air Components. Lightning web components are…
An Introduction To Event Handling Life-cycle in Salesforce
Event Handling Life-cycle:- Mainly we will see how events fire and handling of events in lightning. 1.) Detect Firing of Event This framework first detects…
Popular Salesforce Videos
5 Benefits of Integrating Mulesoft Into Your Business | Salesforce Integration
The MuleSoft integration solution has provided visionaries throughout the world with the power to connect all their data, systems, and devices seamlessly. Swipe to know…
Salesforce Billing and Cryptocurrency
THE GOAL: In this video, you're going to learn how Cryptocurrencies can work with Salesforce Billing. ☝️ BEFORE YOU BEGIN, KNOW THIS: 1. In terms…
Guided Selling with Salesforce CPQ
Do you know how to set up guided selling in Salesforce CPQ? In this demo video, we'll show you three easy steps to set up…