-
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
Communicate Between Components Using Events in Lightning Web Components | Salesforce Developer Guide
Introduction Standard DOM events are dispatched by Lightning web components. Custom events may also be generated and dispatched by components. To communicate the components holding…
Pardot VS. Marketing Cloud: Differences and FAQs [INFOGRAPHICS]
Should I choose Pardot (Marketing Cloud Account Engagement) or Salesforce Marketing Cloud to automate marketing campaigns in Salesforce? Is there any difference? Is Pardot a…
Popular Salesforce Videos
Salesforce Training Videos 1 for beginners with RealTime Projects Salesforce Demo
This video explains what a primary level person should be doing after getting any Salesforce Project. What should be steps for the same.
Hello (Salesforce) World - An introduction to Tableau Developer
Hello, Salesforce world! Curious about Tableau (the newest member of the Salesforce family), our developer platform and suite of developer tools available? Whether you are…
5 Reasons To Choose Marketing Automation For Your Business | Salesforce
With the advancement in technology, it has become imperative to move towards more advanced methods to grow your business. Marketing automation is one method that…

