• computing cloud
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 6
    Replies
Based on the requirement we are using the Send email page .Now the issue is the CC and Bcc Addresses are not working.When i sent a email by adding the CC and Bcc addresses the case got created sucessfully.To send an reply to the customer ,just clicked on the send email button...but in send email page only the TO Addresses and Subject Line got copied whereas the CC and BCC addresses didnt get copy.
I have added the cc and Bcc addresses manually and sent a email.Again when i got a reply from the customer and reresponded at time i could see the cc and Bcc address reflected.
Small Concern why the CC and BCC Addresses are not getting reflected for the first and after adding manually ,it started reflecting .What may the issue .
When their is updation done will it effects the apex ,vf etc.
Any Help very much appreciated.
Hello All ,
I Would like to have a Date Format in an email template for the contract end date.Based on the requirement im using the enddate in an html email template but its displaying the date and time ,but we would like to have only the date displayed.How can i do this.

In Contrac End Date ...its displaying the date and time .But i would like to have only the Date Displayed.
Contract End Date :2016-08-28 00:00:00

Any help very much appreciated.

 
Hello All ,
I had a requirement where i need to add three reports in a dashboard.
These reports have formula fields (one is currency and the other is number).So when we created a dashboard with the reports ,it displays only one formula field (currency ) for all the three reports and the other formula field is not getting displayed in the dashboard.
Can any one suggest what may the issue .
PFA Screen shot :

Dashboard Showing Three reports ....with one field value .
User-added image
But the reports contain two formula fields :
User-added image
Product+Trasfer IYB is not getting displayed in dashboard.
How to get it displayed .Any Suggestion please.
Based on the requirement  we have created the WFR ,where certain conditions should get met for an email notification to go the owner before 100 days of the contract end date. So i have created the a time based workflow rule and a email alert.
Condition is 1:
1)Renewable status is equal to pipeline , next qtr
2)Next Year Status is not equal to renewed or renewed lost.
3)Renewed is true
So while creating a Rule criteria i have used the filter as : This is the Criteria met conditions i have given for 100 days .
((Contract: Contract End DateNOT EQUAL TOnull) AND (Contract: Renewal StatusEQUALS pipeline) ) OR (Contract: Renewal StatusEQUALS next qtr) OR (Contract: Next Year Status NOT EQUAL TO Renewed) OR (Contract: Next Quarter Renewal StatusNOT EQUAL TO Renewed lost))
Now when the 100 days email is sent to the owner ,their is an update done for the field SRR (picklist).
a)If SRR is YES --- then an email notification is sent for 15 /30/45 days .
b)If SRR is No ---- then stop sending email
c)If SRR --not updated with any value and left blank .

Then i need to send an email notification for 90 days before the contract end date to the owner.

1)Renewable status is equal to pipeline , next qtr --picklist field
2)Next Year Status is not equal to renewed or renewed lost.---picklist field
3)Renewed is true ---formula field make it checked
4)SRR is Blank(not updated) ---picklist field.

NOw ,
a)if the SRR field is YES and 15 /30 /45 days email to be sent .
b)If SRR is NO or Blank --stop sending the email.

Formula used is rule criteria:
AND( OR( ISPICKVAL(Renewable status, 'next qtr'), ISPICKVAL(Renewable status, 'pipeline') ), NOT(ISPICKVAL(Next Year Status, 'renewed' )), NOT(ISPICKVAL(Next Year Status, 'renewed lost')) )

Any help very much appreciated.
Hello All ,
Based on the requirement  i have a Batch Class .
Small info needed ...in query locator i have given the conditions for all needed .Now i would like to add if - else condition for one of the condition used in query .Can i use it .
If SRR = Yes --- email should go ,If no -- stop sending email.

Here is the code ...
global class NotificationEmail implements Database.Batchable < sObject >, Schedulable, Database.Stateful {
    global List<String> errorMessages = new List<String>();
    global Database.QueryLocator start(Database.BatchableContext bc) {
        
        Date ed = Date.today().addDays(150);
        System.debug(Date.today().addDays150));
        
        set<Id> setContractIds = new set<Id>();

        for(Contract_role__c objContract: [SELECT  Contract__c FROM Contract_role__c WHERE Role__c = 'SA' AND Contract__r.EndDate =: ed]) {
            setContractIds.add(objContract.Contract__c);
        }
        
         return Database.getQueryLocator([Select  id, Contract_Name__c , EndDate ,Contact_Email__c, Contract_End_Date_2__c,  Account.Owner.Email ,Contact__r.ID FROM Contract  WHERE Id IN: setContractIds AND Renewable__c =True AND Send_Renewal_Reminder__c ='YES' ]);
    }

    global void execute(Database.BatchableContext bc, List < Contract > recs) {
        List < Messaging.SingleEmailMessage > mailList = new List < Messaging.SingleEmailMessage > ();
        for (Contract c: recs) {
            if (c.Contact_Email__c != null && Send_Renewal_Reminder__c ='YES' ) {
                List < String > toAddresses = new List < String > ();
                List < String > CcAddresses = new List < String > ();
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
               
                ccAddresses.add(c.Account.Owner.Email);
               
                mail.setCcAddresses(CcAddresses);
                mail.setTargetObjectId(c.Contact__r.ID);
                mail.setWhatId(c.Id);
                mail.setTemplateId('00X4B000000M2i8');
                mail.setSaveAsActivity(false);
              
                mailList.add(mail);
            
}
else if (c.Contact_Email__c != null && Send_Renewal_Reminder__c ='NO')
{

}
        }
        Messaging.sendEmail(mailList);
    }

    global void finish(Database.BatchableContext bc) {
        AsyncApexJob aaj = [Select Id, Status, NumberOfErrors, JobItemsProcessed, MethodName, TotalJobItems, CreatedBy.Email from AsyncApexJob where Id =:BC.getJobId()];
        
        // Send an email to the Apex job's submitter notifying of job completion.
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {aaj.CreatedBy.Email};
        mail.setToAddresses(toAddresses);
        mail.setSubject('JOB Salesforce Thirty Days NotificationEmailtoCustomer Finished: ' + aaj.Status);
        String bodyText='Total Job Items ' + aaj.TotalJobItems + ' Number of records processed ' + aaj.JobItemsProcessed + ' with '+ aaj.NumberOfErrors + ' failures.\n';
        bodyText += 'Number of Error Messages ' + errorMessages.size() + '\n';
        bodyText += 'Error Message' + String.join(errorMessages, '\n');
        mail.setPlainTextBody(bodyText);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
    }
    
    global void execute(SchedulableContext SC) {
        NotificationEmailtoAccountExecutive batchable = new NotificationEmailtoAccountExecutive();
        database.executebatch(batchable);
    }
}

Any help very much appreciated.

 
Hello All ,
I have a requirement ,where certain conditions should get met for an email notification to go the owner before 100 days of the contract end date.
So i have created the a time based workflow rule and a email alert.
Condition is :
1)Renewable status is equal to pipeline , next qtr
2)Next Year Status is not equal to renewed or renewed lost.
3)Renewed is true
4)SRR is YES

So while creating a Rule criteria i have used the filter as :
This is the Criteria met conditions i ahve given for 100 days .
((Contract: Contract End DateNOT EQUAL TOnull) AND (Contract: Renewal StatusEQUALS pipeline) ) OR (Contract: Renewal StatusEQUALS next qtr) OR (Contract: Next Year  Status NOT EQUAL TO Renewed) OR (Contract: Next Quarter Renewal StatusNOT EQUAL TO Renewed lost)
Now Similarly i would like to send an email notification for 90 days before the contract end date.
1)Renewable status is equal to pipeline , next qtr --picklist field
2)Next Year Status is not equal to renewed or renewed lost.---picklist field
3)Renewed is true ---formula field make it checked
4)SRR is '' ---picklist field

How do i add the 3 & 4 Condition in the formula field.Instead of writing the criteria ,can we go with a formula field
AND( 
OR( 
ISPICKVAL(Renewable status, 'next qtr'), 
ISPICKVAL(Renewable status, 'pipeline') 
), 
NOT(ISPICKVAL(Next Year Status, 'renewed' )), 
NOT(ISPICKVAL(Next Year Status, 'renewed lost')) 
)
Can u let me know which one is better writing a criteria condition or Formula evaluated true .


Any help very much appreciated.
 
Hello All ,
I'm attempting  a requirement  ,an email notification to be sent 100 days before the contract end date to the owner.We have few condition and a field  as "SRR" which will be updated once the email is sent.
Condition 1:
1)Once 100 days email goes out to the owner,Then the field "RR" will be done
it can be 3 situation :
a)If "RR" = Yes , then 90 day email will not go to  owner and it will start 60 day notification to customer.
b)If "RR" = No, then all email will stop (90,60,30,15)
c)If "RR" =  ,don't reply then and its blank then as reminder 90 days email will go out to account owner.

Condition 2:
Once 90 days email go out again it will have 3 condition.
a)If  owner say Yes then 90 day email will not go to customer .
b)If they say No then all email will stop.
c)If they don't reply then also all email will stop.

How can i achieve this?Any example or suggestions very much appreciated.
 
Hello All ,
we have a requirement , to send a email notification to the owner 100 days before the contract end date , for the products which are renewable.
So we have created a formula field (Renewable -- checkbox ) as
Product__r.Renewable__c
but im unable to check the Renewable field .How can i add the condition in the workflow rule .How can i do this?Any Suggestion please.
Hello All ,

I have a requirement where i need to stop sending the email notification to the customer, when the field name "SRR is NO".This field is going to be updated by one of the user.Once it is updated how can i stop sending email.How can i achieve this.Any help very much appreciated.
Hello ,
Based on the requirement i have created few html email templates with the merge fields .When i use the templateid in the batch class and execute the batch class,the email which i get doesnot display the merge fields value .What may be issue .Any help very much appreciated.
Here is the code used to send an email notification for the 30 days .
Batch Class and Schedule Class :
global class ThirtyDaysNotificationEmail implements Database.Batchable < sObject >, Schedulable, Database.Stateful {
    global List<String> errorMessages = new List<String>();
    global Database.QueryLocator start(Database.BatchableContext bc) {
        
        Date ed = Date.today().addDays(30);
        System.debug(Date.today().addDays(30));
        
        set<Id> setContractIds = new set<Id>();

        for(Contract_role__c objContract: [SELECT  Contract__c FROM Contract_role__c WHERE Role__c = 'SA' AND Contract__r.EndDate =: ed]) {
            setContractIds.add(objContract.Contract__c);
        }
        
         return Database.getQueryLocator([Select  id, Contract_Name__c , EndDate ,Contact_Email__c, Contract_End_Date_2__c,  Account.Owner.Email ,Account.Owner.Manager.Email,Owner.Email,CustomerSignedId,OwnerId FROM Contract  WHERE Id IN: setContractIds AND SRR__c ='YES' AND Status__c IN('In Pipe','Pushed Forward ') AND Renewal_Status__c NOT IN ('Renewed','Renewed Lost')]);
    }

    global void execute(Database.BatchableContext bc, List < Contract > recs) {
        List < Messaging.SingleEmailMessage > mailList = new List < Messaging.SingleEmailMessage > ();
        for (Contract c: recs) {
            if (c.Contact_Email__c != null) {
                List < String > toAddresses = new List < String > ();
                List < String > CcAddresses = new List < String > ();
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                toAddresses.add(c.Contact_Email__c);
                ccAddresses.add(c.Account.Owner.Email);
               // toAddresses.add(c.Account.Owner.Manager.Email);
                mail.setToAddresses(toAddresses);
                mail.setCcAddresses(CcAddresses);
               // mail.setTargetObjectId(c.CustomerSignedId);
                mail.setTargetObjectId(c.OwnerId);
               // mail.setWhatId(c.Id);
                mail.setTemplateId('00X4B000000M3g7');
                mail.setSaveAsActivity(false);
               // mail.setSubject('Notification Before 100 Days of Contract End Date to Account Executive and Manager');
               // String messageBody = '<html><body>Hi ,The Contract Named ' + c.Contract_Name__c  + ',<br>Will get Expired within 100 Days . <br>Kindly take approriate action to inform the Customer.<br><br><b>Regards,</b><br>ADP</body></html>';
               // mail.setHtmlBody(messageBody);
                mailList.add(mail);
            }
        }
        Messaging.sendEmail(mailList);
    }

    global void finish(Database.BatchableContext bc) {
        AsyncApexJob aaj = [Select Id, Status, NumberOfErrors, JobItemsProcessed, MethodName, TotalJobItems, CreatedBy.Email from AsyncApexJob where Id =:BC.getJobId()];
        
        // Send an email to the Apex job's submitter notifying of job completion.
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {aaj.CreatedBy.Email};
        mail.setToAddresses(toAddresses);
        mail.setSubject('JOB Salesforce Thirty Days NotificationEmailtoCustomer Finished: ' + aaj.Status);
        String bodyText='Total Job Items ' + aaj.TotalJobItems + ' Number of records processed ' + aaj.JobItemsProcessed + ' with '+ aaj.NumberOfErrors + ' failures.\n';
        bodyText += 'Number of Error Messages ' + errorMessages.size() + '\n';
        bodyText += 'Error Message' + String.join(errorMessages, '\n');
        mail.setPlainTextBody(bodyText);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
    }
    
    global void execute(SchedulableContext SC) {
        NotificationEmailtoAccountExecutive batchable = new NotificationEmailtoAccountExecutive();
        database.executebatch(batchable);
    }
}
HTML Email template Created :
User-added image

The output which i get without the merge fields is :
User-added image
Any help very much appreciated.
I  would like to add few condition in the query,how to add them.Any Suggestion please.

1) Add more roles (such as EB ,TA ,RA etc where role is a picklist field) in this query .
SELECT Contract__c FROM Contract_role__c WHERE Role__c = 'SA'
2)In getquerylocator , add few condition such as
When "Renewed" is Checked AND 
When "SRR" is YES AND 
when the "Status Renewed" is equal to "Status renewed for next quarter " or "Pipeline" AND 
when "Status Renewed next Year" is not equal to "Renewed" or"Renewed lost"
i have the query as
return Database.getQueryLocator('Select id, Contract_Name__c , EndDate ,ownerId FROM Contract WHERE Id IN: setContractIds');
When i try in developer console , it executes and gives the output ,but when i use in getquery locator the output does not comes ...
Select  id, Contract_Name__c , EndDate ,Renewal_Status__c FROM Contract where Status Renewed IN ('Status renewed for next quarter','Pipeline') OR Status Renewed next Year IN ('Renewed','Renewed lost')
Any help very much appreciated.

 
Hi buddy ,
I'm attempting an requirement ,where  an email notification to the sent to the opportunity owner 90 days before the contract end date. Few conditions which are to be followed.Their are two picklist field "Status Renewal" and "Status Renewed next year" .Contact role is a custom object which has "role" has picklist field and has a lookup relation with contract .

Condition to be given is :
a)"Renewal_Status__c" is equal to pipeline ,next renewal status And
 b)when the "Next_Quarter_Renewal_Status__c" is not equal to renewed ,renewed lost.
 c)Contact Role equal to sa/ra/ta.
Once the condition is satisfied , then the email notification is sent to the opportunity owner ,keeping in cc to the contract owner.
Now , if we get the response from the customer for the renewal ,then an update is done by the owner  updating the "send renewal reminder".
We have a picklist field as ''send renewal reminder" with yes or no values..Their few more condition now.
Condition 1:
If the "Send renewal reminder" is "YES" then an email notification mail is to be sent to the customer for 45,30 and 15 days .
for this there are few condition to be followed .
.i.e  a)"Status Renewal" is equal to pipeline ,next renewal status And
b)when the "Status Renewed next year" is not equal to renewed ,renewed lost And
c)"Send renewal reminder" is "YES".

Condition 2:If the "Send renewal reminder" is "No" ,then stop sending the email notification .

Condition 3:If the "Send renewal reminder" is not updated ,then an email notification needs to be sent to the opportunity owner and the superior for 3months.

How can i achieve this ?Any Suggestion or examples very much appreciated.
 
Hello All ,

I have a requirement where i need to stop sending the email notification to the customer, when the field name "SRR is NO".This field is going to be updated by one of the user.Once it is updated how can i stop sending email.How can i achieve this.Any help very much appreciated.
Hello ,
Based on the requirement i have created few html email templates with the merge fields .When i use the templateid in the batch class and execute the batch class,the email which i get doesnot display the merge fields value .What may be issue .Any help very much appreciated.
Here is the code used to send an email notification for the 30 days .
Batch Class and Schedule Class :
global class ThirtyDaysNotificationEmail implements Database.Batchable < sObject >, Schedulable, Database.Stateful {
    global List<String> errorMessages = new List<String>();
    global Database.QueryLocator start(Database.BatchableContext bc) {
        
        Date ed = Date.today().addDays(30);
        System.debug(Date.today().addDays(30));
        
        set<Id> setContractIds = new set<Id>();

        for(Contract_role__c objContract: [SELECT  Contract__c FROM Contract_role__c WHERE Role__c = 'SA' AND Contract__r.EndDate =: ed]) {
            setContractIds.add(objContract.Contract__c);
        }
        
         return Database.getQueryLocator([Select  id, Contract_Name__c , EndDate ,Contact_Email__c, Contract_End_Date_2__c,  Account.Owner.Email ,Account.Owner.Manager.Email,Owner.Email,CustomerSignedId,OwnerId FROM Contract  WHERE Id IN: setContractIds AND SRR__c ='YES' AND Status__c IN('In Pipe','Pushed Forward ') AND Renewal_Status__c NOT IN ('Renewed','Renewed Lost')]);
    }

    global void execute(Database.BatchableContext bc, List < Contract > recs) {
        List < Messaging.SingleEmailMessage > mailList = new List < Messaging.SingleEmailMessage > ();
        for (Contract c: recs) {
            if (c.Contact_Email__c != null) {
                List < String > toAddresses = new List < String > ();
                List < String > CcAddresses = new List < String > ();
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                toAddresses.add(c.Contact_Email__c);
                ccAddresses.add(c.Account.Owner.Email);
               // toAddresses.add(c.Account.Owner.Manager.Email);
                mail.setToAddresses(toAddresses);
                mail.setCcAddresses(CcAddresses);
               // mail.setTargetObjectId(c.CustomerSignedId);
                mail.setTargetObjectId(c.OwnerId);
               // mail.setWhatId(c.Id);
                mail.setTemplateId('00X4B000000M3g7');
                mail.setSaveAsActivity(false);
               // mail.setSubject('Notification Before 100 Days of Contract End Date to Account Executive and Manager');
               // String messageBody = '<html><body>Hi ,The Contract Named ' + c.Contract_Name__c  + ',<br>Will get Expired within 100 Days . <br>Kindly take approriate action to inform the Customer.<br><br><b>Regards,</b><br>ADP</body></html>';
               // mail.setHtmlBody(messageBody);
                mailList.add(mail);
            }
        }
        Messaging.sendEmail(mailList);
    }

    global void finish(Database.BatchableContext bc) {
        AsyncApexJob aaj = [Select Id, Status, NumberOfErrors, JobItemsProcessed, MethodName, TotalJobItems, CreatedBy.Email from AsyncApexJob where Id =:BC.getJobId()];
        
        // Send an email to the Apex job's submitter notifying of job completion.
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {aaj.CreatedBy.Email};
        mail.setToAddresses(toAddresses);
        mail.setSubject('JOB Salesforce Thirty Days NotificationEmailtoCustomer Finished: ' + aaj.Status);
        String bodyText='Total Job Items ' + aaj.TotalJobItems + ' Number of records processed ' + aaj.JobItemsProcessed + ' with '+ aaj.NumberOfErrors + ' failures.\n';
        bodyText += 'Number of Error Messages ' + errorMessages.size() + '\n';
        bodyText += 'Error Message' + String.join(errorMessages, '\n');
        mail.setPlainTextBody(bodyText);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
    }
    
    global void execute(SchedulableContext SC) {
        NotificationEmailtoAccountExecutive batchable = new NotificationEmailtoAccountExecutive();
        database.executebatch(batchable);
    }
}
HTML Email template Created :
User-added image

The output which i get without the merge fields is :
User-added image
Any help very much appreciated.
I  would like to add few condition in the query,how to add them.Any Suggestion please.

1) Add more roles (such as EB ,TA ,RA etc where role is a picklist field) in this query .
SELECT Contract__c FROM Contract_role__c WHERE Role__c = 'SA'
2)In getquerylocator , add few condition such as
When "Renewed" is Checked AND 
When "SRR" is YES AND 
when the "Status Renewed" is equal to "Status renewed for next quarter " or "Pipeline" AND 
when "Status Renewed next Year" is not equal to "Renewed" or"Renewed lost"
i have the query as
return Database.getQueryLocator('Select id, Contract_Name__c , EndDate ,ownerId FROM Contract WHERE Id IN: setContractIds');
When i try in developer console , it executes and gives the output ,but when i use in getquery locator the output does not comes ...
Select  id, Contract_Name__c , EndDate ,Renewal_Status__c FROM Contract where Status Renewed IN ('Status renewed for next quarter','Pipeline') OR Status Renewed next Year IN ('Renewed','Renewed lost')
Any help very much appreciated.

 
Hi buddy ,
I'm attempting an requirement ,where  an email notification to the sent to the opportunity owner 90 days before the contract end date. Few conditions which are to be followed.Their are two picklist field "Status Renewal" and "Status Renewed next year" .Contact role is a custom object which has "role" has picklist field and has a lookup relation with contract .

Condition to be given is :
a)"Renewal_Status__c" is equal to pipeline ,next renewal status And
 b)when the "Next_Quarter_Renewal_Status__c" is not equal to renewed ,renewed lost.
 c)Contact Role equal to sa/ra/ta.
Once the condition is satisfied , then the email notification is sent to the opportunity owner ,keeping in cc to the contract owner.
Now , if we get the response from the customer for the renewal ,then an update is done by the owner  updating the "send renewal reminder".
We have a picklist field as ''send renewal reminder" with yes or no values..Their few more condition now.
Condition 1:
If the "Send renewal reminder" is "YES" then an email notification mail is to be sent to the customer for 45,30 and 15 days .
for this there are few condition to be followed .
.i.e  a)"Status Renewal" is equal to pipeline ,next renewal status And
b)when the "Status Renewed next year" is not equal to renewed ,renewed lost And
c)"Send renewal reminder" is "YES".

Condition 2:If the "Send renewal reminder" is "No" ,then stop sending the email notification .

Condition 3:If the "Send renewal reminder" is not updated ,then an email notification needs to be sent to the opportunity owner and the superior for 3months.

How can i achieve this ?Any Suggestion or examples very much appreciated.