function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
shekhar 46shekhar 46 

VFP buttons to for actions

I want to share the inputdata takenn on vfp on send mail to ceo button, reset button & generate pdf button on vfp.
--
< apex:page controller="VendorRegClass" renderAs="{!render}" id="rer" >
< apex:form >
<apex:pageBlock title="VendorRegistrationForm">
<apex:Outputlabel value="Vendor company nname"/>
<apex:inputText value="{!VendorCompanyName}"/>
<apex:Outputlabel value="Vendor contact person"/>
<apex:inputText value="{!VendorContactPerson}"/>
<apex:Outputlabel value="Amount per event"/>
<apex:inputText value="{!AmountPerEvent}"/>
<apex:Outputlabel value="City"/>
<apex:inputText value="{!City}"/>
<apex:Outputlabel value="Country"/>
<apex:inputText value="{!country}"/>
<apex:PageBLockButtons>
<apex:commandButton value="Send" action="{!Send}"/>
<apex:commandButton value="Reset" action="{!reset}"/>
<apex:commandButton value="Generate Pdf" action="{!Showpdf}"/>
</apex:PageBLockButtons>
<apex:OutputLabel value="{!message}"/>
</apex:pageBlock>
</apex:form>
</apex:page>
--
controller
 ublic class VendorRegClass {
public string VendorCompanyName{get;set;}
public string VendorContactPerson{get;set;}
public string AmountPerEvent{get;set;}
public string City{get;set;}
public string country{get;set;}
public string render{set;get;}
public boolean showpdf{set;get;}
public static void Send(){
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
String[] toAddresses = new String[] {'abc@yahoo.com'};
mail.setToAddresses(toAddresses);
mail.setBccSender(false);
mail.setSubject('Subject');
mail.setPlainTextBody('Test Message Body');
Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});
for ( Messaging.SendEmailResult result : r ) {
if ( !r[0].isSuccess () ) {
System.debug ( result );
}
else {
ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.INFO, 'Email Sent Successfully' ); ApexPages.addMessage(msg);
} } }
public static void reset(){
VendorCompanyName='';
VendorContactPerson='';
AmountPerEvent='';
City=''; country='';
}
public static void ShowPdf(){
if(render==null){ render='pdf';
} }}
SwethaSwetha (Salesforce Developers) 
HI Shekhar,
What is the challenge /where you are stuck with the code you've shared above?  Thanks