• Taresh Pandey 19
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies
Good Evening Mates,
I want to display my text field record in a popup window, while clicking other link field which exsist in the same object. Please refer following image
User-added image
any help would appreciated. Please tell me ASAP.

Regards'
Taresh pandey
Hello Mates,

I need some information about the keyword searching in email body(emails are logging in Activity History of Salesforce).
I need to create some automated reports based on some keywords (like Positive, Not interested). And I need to search these kind of keywords in email body whichever we get from our clients email reply.
    Is there any way in Salesforce that we can separate emails which are containing some special keywords ?
And based on those email we can generate an automated report of our leads and contacts.
and also I need to know where we can define those keywords in salesforce.

Thank you all in advance

Best Regards'
Taresh Pandey
Hi Mates,
I have wrote a trigger on task but i'm not able to get test coverage in side nested IF ELSE condition, can anyone suggest me, how can I bring this code into testCoverage. Please refer following code.
if(Trigger.isAfter){
        if(Trigger.isInsert ||Trigger.isUpdate){
        Set<ID> ContactIDis = new Set<ID>();
          list<Contact> Con_logs = new list<Contact>();
          for(Task tasklogs: trigger.new){
                ContactIDs.add(tasklogs.WhoId);
            }
            for(Contact conlogs : [SELECT Id, 
                          Name,
                          Contact_Status__c,
                          Next_Follow_Up_Date__c,(SELECT ID,
                                          AccountId,
                                          Activity__c,
                                          CallDisposition,
                                          CallObject,
                                          CallType,
                                          Contact_Name__c,
                                          CreatedDate,
                                          Subject,
                                          WhatId,
                                          WhoId FROM Tasks ///ORDER BY CallDisposition ASC NULLS LAST
                                      )FROM Contact Where ID IN :ContactIDis ]){
              try{
                  for(Task tasklogs : conlogs.Tasks){
                    if(tasklogs.CallDisposition == 'Do Not Disturb' || tasklogs.CallDisposition == 'Negative' ){
                      conlogs.Contact_Status__c = 'Negative';
                    }else if(tasklogs.CallDisposition == 'Voice Mail'){
                      conlogs.Next_Follow_Up_Date__c = System.today()+1;
                    }else if(tasklogs.CallDisposition == 'No Response' || tasklogs.CallDisposition == 'Person Unavailable' || tasklogs.CallDisposition == 'Person Busy'){
                      conlogs.Next_Follow_Up_Date__c = System.today()+2;
                    }else{
                      conlogs.Next_Follow_Up_Date__c = Null;
                    }
                  Con_logs.add(conlogs);
                  }
              }catch(exception e){
                  system.debug('Got an exception');
              }
            }  
              upsert Con_logs;
        }
    }
I'm not getting coverage in the bold highlighted area.
Test Class :
@isTest
private class TaskUpdateContact_Test {
   
    static testmethod void test_trigger(){
    List<Contact> l = new List<Contact>();
    List<Task> task_list = new List<Task>();
    
        Account acc = new Account(Name = 'testAccount');
        insert acc;
        Contact a =New Contact(); // creating new contact
            a.LastName='Sri';
            a.MailingCountry='INDIA';
            a.MailingCity='Mumbai';
            a.Email='abc@example.com';
            a.Phone='11111111';
            a.AccountID = acc.ID;
            a.Next_Follow_Up_Date__c = system.today();
        insert a;
                
        //Creating new task
        Task task1= new task();
            task1.Subject='Call';
            task1.status='Completed';
            task1.Whoid=a.id;
            task1.ActivityDate=Date.Today();
            task1.CallDisposition ='Negative';
            task1.FastCall__Call_Notes__c = 'abc';
            task_list.add(task1);
        insert task_list;
        // Updating existing contact 
        test.startTest();
        if(task1.CallDisposition == 'Voice Mail'){
            a.MailingCity = 'Pune';
            a.Next_Follow_Up_Date__c = system.today()+3;
            //a.ID = task1.whoID;
        }else if(task1.CallDisposition == 'Negative'){
            a.Contact_Status__c = 'Negative';
        }
        update a;
        l.add(a);
        //test.startTest();
        upsert l;
        test.stopTest();    

         
    }
}

Any help would be appreciated, please reply ASAP

Regards'
Taresh
Hello Friend,
I have created some workflows for:
1- If contact isNew or contact owner is changed then Datefield__c would be update with Today(), and followUp_date__c would be Today() + 2 days
    At the same time it would create some Tasks, which are having followUp_date__c as Task's due date.
    for this I'm using below formula as workflow rule. which is working fine.
      
          OR(ISNEW() ,ISCHANGED(OwnerId))

2- Next workflow would be - if Datefield__c is 3 day old then this rule should be trigger. followUp_date__c would be Datefield__c + 3 Days
          for second flow I'm using below formula as Rule criteria.
 
Datefield + 3 = Today()
          this rule is not working, so I'm wondering if I update second workflow rule with 
DATEVALUE( TEXT(DateField__c+ 3)) = Today()
        would it work ? or I'm completely making this formula incorrect.


​Any help would be appreciated


Best Regards'
Taresh Pandey

 
My trigger should have work, but it's not working. please advise me where went I wrong ?

trigger NextFollowUpDateofContactIntoAccount on Contact (after INSERT, after UPDATE, after DELETE){
   
   List<Account> Acc_List = new List<Account>();
   Set<ID> setAccountIDs = new Set<ID>();
   if(Trigger.isInsert ||Trigger.isUpdate){
        for(Contact c : Trigger.new){
            setAccountIDs.add(c.AccountId);
        }
   }
   if(Trigger.isDelete){
       for(Contact c : Trigger.old){
            setAccountIDs.add(c.AccountId);
        }
   }
        Date NextFloowUpDate = null;
        Date YesterdaysDate = system.today()-1;

    List<Account> accounts = [SELECT    Id,
                                        Name,(
                                        Select ID, 
                                        Name, 
                                        Next_Follow_Up_Date__c, 
                                        Important__c 
                                        FROM Contacts  ORDER BY Next_Follow_Up_Date__c, systemModstamp DESC Nulls last limit 1 
                                        )
                                        FROM Account WHERE ID IN :setAccountIDs ORDER BY SystemModstamp ]; 
    try{
        for(Account a : accounts){

            for(Contact c : a.Contacts){
                NextFloowUpDate  = c.Next_Follow_Up_Date__c ;
                    if(c.Important__c == true && c.Next_Follow_Up_Date__c != null && c.Next_Follow_Up_Date__c > YesterdaysDate){
                        a.Next_Follow_Up_Date__c = NextFloowUpDate;
                        }else if(c.Important__c == false && c.Next_Follow_Up_Date__c != null && c.Next_Follow_Up_Date__c > YesterdaysDate){
                            a.Next_Follow_Up_Date__c  = NextFloowUpDate+7;
                            }else{
                                a.Next_Follow_Up_Date__c  =  null ;
                            }
                            Acc_List.add(a);
            }
        }
     }catch(Exception e){
            system.debug('Got an exception');
    }
    upsert Acc_List;
    
}
Hi Mates,
I have wrote a trigger on task but i'm not able to get test coverage in side nested IF ELSE condition, can anyone suggest me, how can I bring this code into testCoverage. Please refer following code.
if(Trigger.isAfter){
        if(Trigger.isInsert ||Trigger.isUpdate){
        Set<ID> ContactIDis = new Set<ID>();
          list<Contact> Con_logs = new list<Contact>();
          for(Task tasklogs: trigger.new){
                ContactIDs.add(tasklogs.WhoId);
            }
            for(Contact conlogs : [SELECT Id, 
                          Name,
                          Contact_Status__c,
                          Next_Follow_Up_Date__c,(SELECT ID,
                                          AccountId,
                                          Activity__c,
                                          CallDisposition,
                                          CallObject,
                                          CallType,
                                          Contact_Name__c,
                                          CreatedDate,
                                          Subject,
                                          WhatId,
                                          WhoId FROM Tasks ///ORDER BY CallDisposition ASC NULLS LAST
                                      )FROM Contact Where ID IN :ContactIDis ]){
              try{
                  for(Task tasklogs : conlogs.Tasks){
                    if(tasklogs.CallDisposition == 'Do Not Disturb' || tasklogs.CallDisposition == 'Negative' ){
                      conlogs.Contact_Status__c = 'Negative';
                    }else if(tasklogs.CallDisposition == 'Voice Mail'){
                      conlogs.Next_Follow_Up_Date__c = System.today()+1;
                    }else if(tasklogs.CallDisposition == 'No Response' || tasklogs.CallDisposition == 'Person Unavailable' || tasklogs.CallDisposition == 'Person Busy'){
                      conlogs.Next_Follow_Up_Date__c = System.today()+2;
                    }else{
                      conlogs.Next_Follow_Up_Date__c = Null;
                    }
                  Con_logs.add(conlogs);
                  }
              }catch(exception e){
                  system.debug('Got an exception');
              }
            }  
              upsert Con_logs;
        }
    }
I'm not getting coverage in the bold highlighted area.
Test Class :
@isTest
private class TaskUpdateContact_Test {
   
    static testmethod void test_trigger(){
    List<Contact> l = new List<Contact>();
    List<Task> task_list = new List<Task>();
    
        Account acc = new Account(Name = 'testAccount');
        insert acc;
        Contact a =New Contact(); // creating new contact
            a.LastName='Sri';
            a.MailingCountry='INDIA';
            a.MailingCity='Mumbai';
            a.Email='abc@example.com';
            a.Phone='11111111';
            a.AccountID = acc.ID;
            a.Next_Follow_Up_Date__c = system.today();
        insert a;
                
        //Creating new task
        Task task1= new task();
            task1.Subject='Call';
            task1.status='Completed';
            task1.Whoid=a.id;
            task1.ActivityDate=Date.Today();
            task1.CallDisposition ='Negative';
            task1.FastCall__Call_Notes__c = 'abc';
            task_list.add(task1);
        insert task_list;
        // Updating existing contact 
        test.startTest();
        if(task1.CallDisposition == 'Voice Mail'){
            a.MailingCity = 'Pune';
            a.Next_Follow_Up_Date__c = system.today()+3;
            //a.ID = task1.whoID;
        }else if(task1.CallDisposition == 'Negative'){
            a.Contact_Status__c = 'Negative';
        }
        update a;
        l.add(a);
        //test.startTest();
        upsert l;
        test.stopTest();    

         
    }
}

Any help would be appreciated, please reply ASAP

Regards'
Taresh
My trigger should have work, but it's not working. please advise me where went I wrong ?

trigger NextFollowUpDateofContactIntoAccount on Contact (after INSERT, after UPDATE, after DELETE){
   
   List<Account> Acc_List = new List<Account>();
   Set<ID> setAccountIDs = new Set<ID>();
   if(Trigger.isInsert ||Trigger.isUpdate){
        for(Contact c : Trigger.new){
            setAccountIDs.add(c.AccountId);
        }
   }
   if(Trigger.isDelete){
       for(Contact c : Trigger.old){
            setAccountIDs.add(c.AccountId);
        }
   }
        Date NextFloowUpDate = null;
        Date YesterdaysDate = system.today()-1;

    List<Account> accounts = [SELECT    Id,
                                        Name,(
                                        Select ID, 
                                        Name, 
                                        Next_Follow_Up_Date__c, 
                                        Important__c 
                                        FROM Contacts  ORDER BY Next_Follow_Up_Date__c, systemModstamp DESC Nulls last limit 1 
                                        )
                                        FROM Account WHERE ID IN :setAccountIDs ORDER BY SystemModstamp ]; 
    try{
        for(Account a : accounts){

            for(Contact c : a.Contacts){
                NextFloowUpDate  = c.Next_Follow_Up_Date__c ;
                    if(c.Important__c == true && c.Next_Follow_Up_Date__c != null && c.Next_Follow_Up_Date__c > YesterdaysDate){
                        a.Next_Follow_Up_Date__c = NextFloowUpDate;
                        }else if(c.Important__c == false && c.Next_Follow_Up_Date__c != null && c.Next_Follow_Up_Date__c > YesterdaysDate){
                            a.Next_Follow_Up_Date__c  = NextFloowUpDate+7;
                            }else{
                                a.Next_Follow_Up_Date__c  =  null ;
                            }
                            Acc_List.add(a);
            }
        }
     }catch(Exception e){
            system.debug('Got an exception');
    }
    upsert Acc_List;
    
}
The only error I am getting on the below is that it says "File only saved locally, not to server" in the Warnings section, and of course it is not showing up in the ui.
 
I am sure this is something simple, but I have not found it yet.  Any help would be greatly appreciated.
 
Thanks,
 
 
Code:
trigger SiteLeaseEndDate on Site_Lease_Contract__c (after update) {
 private Site_Lease_Contract__c[] newSiteLeaseEndDate = Trigger.new;
 Double Months = newSiteLeaseEndDate[0].Lease_Term_In_Months__c;
 Double y = Months;
 Integer x = y.intvalue();
 newSiteLeaseEndDate[0].End_Date_2__c = newSiteLeaseEndDate[0].Start_Date__c.addMonths(x);
}

 
  • December 10, 2008
  • Like
  • 0