-
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
Upcoming Market Trends in Salesforce CRM
“SALESFORCE has reached a long distance since late nineties. That was the time, when people use to consider it as a business tool for Salesforce…
Salesforce Engage: Ideal Link Between Marketing and Sales
The cohesion between the marketing and sales teams is vital in the business world as it allows concerted efforts, speeding up sales cycles, and optimizing…
Record-Triggered Flows in Salesforce - A Short Guide
Auto-launched flows in record triggers make additional updates after they are saved to the triggering record or database. One of the many different types of Flows…
Popular Salesforce Videos
A Year of Innovation and Growth for Kizzy Consulting - Top Salesforce Partner!
2023 was an amazing year for Kizzy Consulting - Top Salesforce Partner! We achieved the status of Salesforce Ridge Partner, completed numerous Salesforce certifications, and…
Salesforce Stock Pops on Better-than-expected Earnings and Guidance
Salesforce shares rose as much as 3% in extended trading on Wednesday after the enterprise software maker reported fiscal second-quarter earnings and forward guidance that…
TrailheaDX 2020 - How Salesforce Plans To Make Virtual TDX2020 Better
For Salesforce, taking TrailheaDX digital is about more than just keeping the event going, the company wants to make TDX a better, more inclusive, and…

