• Nahian Islam
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 10
    Replies

I am in Setup>>Create>>Objects>>MyCustomObject>>PercentField(Value_c).

I have a validation set for this percent type field: Value_c< 0 ||  Value_c> 1.0 for which It displays error if this condition satisfies.

My Problem:

Whenever there is a 'blank' value sent to Value_c, it automatically reflects as 0%.
I want it to reflect as a simple blank in the field.

Please Guide!

 

The email to be sent will have the custom field values (Contract Name, Contract Number) in the body/subject of the mail

What I have done:
Created an apex class for the email:

public class send_Email
{
    public void sendMailTo()
    {  
        
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
      
        String[] toAddresses = new String[] {'nahian.islam@gmail.com'};
        String[] ccAddresses = new String[] {'nahian.islam@gmail.com'};
      
        email.setToAddresses(toAddresses);
        email.setCcAddresses(ccAddresses);
        
        email.setSubject('< Contract Number>');
      
        String mailBody = 'Dear Nahian,'+
                  '<br><br>'+
                  '<br><br>This is a test mail'+
                  '<br><br>'Please approve this contract'+
                  '<br><br>This is a test mail'+
                  '<br><br>'+
                  '<br><br>Regards,'+
                  '<br><br>SFDC';

        email.setHTMLBody(mailBody);
        
      
        try
        {
            
            Messaging.reserveSingleEmailCapacity(1);
            Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
         
        }
      
        catch(Exception e)
        {
            system.debug('Email limit exceeded');
        }  
          
    }
    
}

Created Visualforce Page:
<apex:page controller="send_Email" action="{!sendMailTo}"> Email Sent Successfully! </apex:page>

I do not know how to fetch the Contract name from where the user is clicking the button.
 
PLEASE HELP

I am in Setup>>Create>>Objects>>MyCustomObject>>PercentField(Value_c).

I have a validation set for this percent type field: Value_c< 0 ||  Value_c> 1.0 for which It displays error if this condition satisfies.

My Problem:

Whenever there is a 'blank' value sent to Value_c, it automatically reflects as 0%.
I want it to reflect as a simple blank in the field.

Please Guide!

 

The email to be sent will have the custom field values (Contract Name, Contract Number) in the body/subject of the mail

What I have done:
Created an apex class for the email:

public class send_Email
{
    public void sendMailTo()
    {  
        
        Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
      
        String[] toAddresses = new String[] {'nahian.islam@gmail.com'};
        String[] ccAddresses = new String[] {'nahian.islam@gmail.com'};
      
        email.setToAddresses(toAddresses);
        email.setCcAddresses(ccAddresses);
        
        email.setSubject('< Contract Number>');
      
        String mailBody = 'Dear Nahian,'+
                  '<br><br>'+
                  '<br><br>This is a test mail'+
                  '<br><br>'Please approve this contract'+
                  '<br><br>This is a test mail'+
                  '<br><br>'+
                  '<br><br>Regards,'+
                  '<br><br>SFDC';

        email.setHTMLBody(mailBody);
        
      
        try
        {
            
            Messaging.reserveSingleEmailCapacity(1);
            Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
         
        }
      
        catch(Exception e)
        {
            system.debug('Email limit exceeded');
        }  
          
    }
    
}

Created Visualforce Page:
<apex:page controller="send_Email" action="{!sendMailTo}"> Email Sent Successfully! </apex:page>

I do not know how to fetch the Contract name from where the user is clicking the button.
 
PLEASE HELP