APEX Salesforce.com Visual Force Visualforce

Sending Email with Attachment using Apex class and Visualforce page

Apex Class: Public with sharing class SendemailController{ public String caseId {get;set;} Public SendemailController(){ caseId = ApexPages.currentPage().getParameters().get(‘Id’); } Public Pagereference sendEmailFunction(){ Case getEmail = [SELECT Id, Contact.Email FROM Case WHERE id=:caseId]; if(getEmail.Contact.Email != null) { String toaddress = getEmail.Contact.Email; try {…

Read More
APEX SALESFORCE Visual Force Visualforce

Adding Error Message in the Visualforce page through Apex controller

Adding Error Message in the Visualforce page through Apex controller Syntax : <apex:pageMessages ></apex:pageMessages> Apex Controller: public class ErrorMsgController { public void DisplayError(){ Apexpages.addMessage( new ApexPages.Message (ApexPages.Severity.ERROR, ‘Required fields are missing. ‘)); //FATAL, WARNING, INFO, CONFIRM } } VF Page:…

Read More