• bhanu reddy 24
  • NEWBIE
  • 24 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 37
    Replies
// sending email to only one person

public class SendMailController {

    public String z { get; set; }

    public String y { get; set; }

    public String     x { get; set; }

    public void saveMethod() {
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        string[] xyz =new string[] {x};  
        mail.setToAddresses(xyz);
        mail.setSubject(y);
        mail.setHtmlBody(z);
          
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});
    }
   
  }


// visual force page

<apex:page controller="SendMailController" sidebar="false">
  <apex:form >
   <apex:pageBlock >
    <apex:pageBlockSection >
     <apex:outputLabel value="To"/>
     <apex:inputText value="{!x}" />
   
     <apex:outputLabel value="Subject"/>
     <apex:inputText value="{!y}"/>
     
     <apex:outputLabel value="Body"/>
     <apex:inputTextarea value="{!z}"/>
      
    </apex:pageBlockSection> 
     <apex:pageBlockButtons location="bottom"> 
       <apex:commandButton value="Send" action="{!saveMethod}" />
     </apex:pageBlockButtons>
     
   </apex:pageBlock>
  </apex:form>
</apex:page> 
how to show 3 objects data in data table by using visualforce page
// sending email to only one person

public class SendMailController {

    public String z { get; set; }

    public String y { get; set; }

    public String     x { get; set; }

    public void saveMethod() {
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        string[] xyz =new string[] {x};  
        mail.setToAddresses(xyz);
        mail.setSubject(y);
        mail.setHtmlBody(z);
          
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});
    }
   
  }


// visual force page

<apex:page controller="SendMailController" sidebar="false">
  <apex:form >
   <apex:pageBlock >
    <apex:pageBlockSection >
     <apex:outputLabel value="To"/>
     <apex:inputText value="{!x}" />
   
     <apex:outputLabel value="Subject"/>
     <apex:inputText value="{!y}"/>
     
     <apex:outputLabel value="Body"/>
     <apex:inputTextarea value="{!z}"/>
      
    </apex:pageBlockSection> 
     <apex:pageBlockButtons location="bottom"> 
       <apex:commandButton value="Send" action="{!saveMethod}" />
     </apex:pageBlockButtons>
     
   </apex:pageBlock>
  </apex:form>
</apex:page> 
public class SendMailController {

    public String z { get; set; }

    public String y { get; set; }

    public String x { get; set; }

    public void saveMethod() {
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        string[] xyz =new string[] {x};  
        mail.setToAddresses(xyz);
        mail.setSubject(y);
        mail.setHtmlBody(z);    
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] {mail});
    }
   
  }

I'm trying to set-up a workflow to simply send a birthday greeting to contacts on the day of their birthday.
 
Initially I created a custom "Next Birthday" contact field -- Calculates the date of the contact's next birthday (based on Birthdate field).
 
Then, I set up a workflow to trigger when TODAY()=Next_Birthday__c...along with workflow actions to send an email and a task to record the activity.

 

However, SFDC support explains that only actions (adding or updating records) can trigger a workflow. 

 

How can I use changes in the current date as a trigger for workflows? Open to any work-arounds.