-
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 for Non-Profit - A Guide
Salesforce is undoubtedly a very powerful platform. Salesforce CRM implementation has spread across all the sectors of the market have seen witnessed and experienced its…

Top Salesforce Features for Developers to Try Out in 2022
With Spring ‘22 release, there’s a lot that’s new for Salesforce developers that they can look forward to. The release has come up with some…

All You Need to Know About Workbench in Salesforce
Salesforce Workbench is a powerful tool for developers and administrators who work with Salesforce on a regular basis. It is an online application that allows…
Popular Salesforce Videos
TrailheaDX '18 Opening Keynote - Part 3: Connect Every Experience
Salesforce TrailheaDX ’18 Opening Keynote – Part 1: Create Connected Customer Experiences TrailheaDX ’18 Opening Keynote – Part 2: Salesforce Platform Salesforce TrailheaDX ’18 Opening…
How to Trigger the Lead Assignment Rule from Flow Builder
In this video, we will talk about how to trigger the lead assignment rule from the flow builder Salesforce. Here is the timestamp for your…
How does Salesforce Field Service Platform increase servicing revenue for your company
CRM Salesforce, along with its Field Service Lightning App, is drastically improving the field-force productivity in the industry. Built on the Salesforce Service Cloud, it…