-
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
Best Practices for Salesforce Sales Cloud Implementation
In today’s competitive sales landscape, businesses need more than just a CRM, they need a system that delivers visibility, automation, and actionable insights. Salesforce Sales…
How to Increase Your Sales Leveraging Digital Transformation? | Salesforce Guide
Now, the shopping experience is not confined to stores. It has been spread across multiple channels including online, mobile, and over the phone. With shoppers…
Salesforce Product : Health Cloud
On huge focus upon the healthcare industry the world's #1 CRM Salesforce has introduced something best product which is termed as Health Cloud. A product…
Popular Salesforce Videos
How To Create Permission Set Group | Salesforce Development Tutorial
How to create permission set groups. This video will cover the following points - 1. Introduction Get a brief introduction about Permission Set Groups. 2.…
Simplify Case Management in Salesforce With Email-to-Case Advance
While Email-to-Case is one of the most widely used features in Salesforce Service Cloud, its limited functionalities may hold you back. At Grazitti, the Salesforce…
Salesforce Service Cloud Telephony
Natterbox CTI and Telephony inside Salesforce ServiceCloud. Transform your telephony experience and empower your agents with fast and personalised support.

