-
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
Passing the Salesforce AI Specialist Certification with Dumpsforsure – Your Complete Success Guide
Introduction : The Salesforce AI Specialist certification has quickly become one of the most valuable credentials for professionals working in artificial intelligence and CRM technology.…
Salesforce Integration Mistakes to Avoid for Better Outcomes
Companies today rely on multiple work apps to manage diverse business functions. Right from HR, Finance, to Marketing & Sales, teams make use of various…
Salesforce for Nonprofits: Problems, Use Cases, and Tips
Each NGO has an impactful mission that helps transform the society we live in. However, the path to success holds a lot of difficulties that…
Popular Salesforce Videos
How to Get Experience Without the Job? | Salesforce Learning
Want to get experience without the job? Watch the full episode here: https://youtu.be/oG8sHOW8GI4 Shrey is a Chief Executive Officer at Cyntexa, a SILVER Salesforce Consulting…
Salesforce Quickbooks Integration | eShopSync for Quickbooks
Product Sync? Invoice Sync? And more? eShopSync for Quickbooks brings out the best-class solution for Salesforce Quickbooks Integration. Click on the link to know more:…
Creating Massive Junction Records with LWC | Salesforce Lightning Tutorial
Don't miss this new interchange session with Jorge Ortega and Alba Rivas! They'll discuss how to build an LWC that allows you to easily create…

