• shweta raghav 13
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 7
    Replies
getting error:Apex trigger TaskCreate caused an unexpected exception, contact your administrator: TaskCreate: execution of AfterInsert caused by: System.StringException: Invalid id: ABC: Trigger.TaskCreate: line 15, column 1

trigger TaskCreate on Task (after insert, after update){
    if(trigger.isAfter){
        if(trigger.isInsert || trigger.isUpdate){
            List<Task>Tasklist=new List<Task>();
            for(Task ts : trigger.new){
                if(ts.Status == 'Completed' ){
                    system.debug('ts.Status------'+ts.Status);
                    system.debug('tss------'+ts);
                    Task td = new task();
                    td.WhoId=ts.WhoId;
                    td.Status='Not Started';
                    td.Subject=ts.Next_Step__c;
                    td.ActivityDate=ts.Next_Step_Due_Date__c;
                    td.Inside_Sales_Reps__c=ts.Inside_Sales_Reps__c;      
                    td.OwnerId=ts.Next_Step_Owner__c;            
                    Tasklist.add(td);
                    system.debug('Tasklist------'+Tasklist);
                } 
            }if(Tasklist.size()>0){
                try{
                    insert Tasklist;
                }
                catch(exception e){
                    system.debug('---e---'+e);
                }
            }            
        }
    }    
}
if(oppList.size()>0){
               for(Opportunity opp : oppList){
                   if(opp.StageName== '100% - Closed Won'){                    
                       Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();
                       message.toAddresses = new String[] {'sh@gmail.com'};
                       message.optOutPolicy = 'FILTER';
                       message.setSubject(' New attachment on Opportunity : ' + '  ' + opp .name+'    ' +'with probability 100% for Account'+'  ' + opp.Account.Name);
                       message.setHtmlBody ('Hi Team, <br/><br/> There is a new attachment for opportunity '+opp .name+'  Please review the attached document<br/><br/><a href=&#34;https://c3.salesforce.com/'+opp.id+'&#34;>https://c3.salesforce.com/'+opp.id+'</a><br/><br/>Regards<br/><br/>Salesforce Admin');
              
                      for(Attachment a : trigger.new){
                           if(a.parentId == opp.id){
                                Messaging.Emailfileattachment efa = new Messaging.Emailfileattachment();
                                efa.setFileName(a.Name);
                                efa.setBody(a.Body);
                                efa.setContentType(a.ContentType);
                                fileAttachments.add(efa);
                          }
                      }
                          if(!fileAttachments.isEmpty()){
                                Message.setFileAttachments(fileAttachments);
                                Messaging.sendEmail(new Messaging.SingleEmailMessage[] {message });
                          }
trigger PracticeFrmOpp on SSO__c (before insert,before update) {
    Set<Id> accIds = new Set<Id>();
    
    for(SSO__c sso :trigger.new) {
        accIds.add(sso.Opportunity_Name__c);
    }   
    Map<Id,opportunity> mappractice = new Map<Id,opportunity>([select id, Practiceu__c from opportunity
                                                                where id in :accIds]);
    for(SSO__c sso:trigger.new) {
        if(mappractice != null && mappractice .containsKey(sso.Opportunity_Name__c)) {
            opportunity OppRecord = mappractice .get(sso.Opportunity_Name__c);
            sso.Practice_test__c= OppRecord .Practiceu__c ;
        }
    }
}
else{
                                    integer k = 0;
                                    for(Opportunity_Splits__c s :oSplit){
                                        if(k == 0){
                                            s.Practice__c= pract;
                                            s.Percent__c= 100;
                                            oppspiltUpdatelist.add(s);
                                            k++;
                                        }else{
                                            oppspiltdeletelist.add(s);
                                        }
                                    }
                                }
                            }else{
                                if(oSplit.size() == 1){
                                    for(Opportunity_Splits__c s :oSplit){
                                        if(oldCount == 0){
                                            s.Practice__c= pract;
                                            s.Percent__c= 50;
                                            oppspiltUpdatelist.add(s);
                                            oldCount++;
                                        }else{
                                            Opportunity_Splits__c op =new Opportunity_Splits__c();
                                            op.Practice__c= pract;
                                            op.Percent__c= 50;
                                            op.Opportunity__c= opp.id;
                                            oppspiltNewlist.add(op);
                                        }
                                    }
                                }else{                                
                                    if(oldValue == 0){
                                        oSplit[0].Practice__c= pract;
                                        oSplit[0].Percent__c= 50;
                                        oppspiltUpdatelist.add(oSplit[0]);
                                        oldIds.add(oSplit[0].id);
                                        oldValue++;
                                    }else if(oldValue == 1){
                                        oSplit[1].Practice__c= pract;
                                        oSplit[1].Percent__c= 50;
                                        oppspiltUpdatelist.add(oSplit[1]);
                                        oldIds.add(oSplit[1].id);
                                        oldValue++;
                                        System.debug('test ++ oSplit '+oSplit.size() +' , oldValue '+oldValue+' , oldIds '+oldIds);
                                        if(oSplit.size() >2){
                                            for(Opportunity_Splits__c s :oSplit){
                                                if(!oldIds.Contains(s.id))
                                                    oppspiltdeletelist.add(s);
                                            }
                                        } 
                                    }                                    
                                }
                            }
                        
                        }else{                        
                            Opportunity_Splits__c ONew=new Opportunity_Splits__c();
                            ONew.Practice__c= pract;
                            ONew.Percent__c= 100;
                            ONew.Opportunity__c= opp.id;
                            oppspiltNewlist.add(ONew);
                        }
                    }
                }
            }
        }        
    }
    
    if(!oppspiltdeletelist.isEmpty())
        delete oppspiltdeletelist;  
        
    if(!oppspiltUpdatelist.isEmpty())
        update oppspiltUpdatelist;
    
    if(!oppspiltNewlist.isEmpty())
        insert oppspiltNewlist;    
        
}
Trying below code but getting error :
Apex trigger oppsplicreate caused an unexpected exception, contact your administrator: oppsplicreate: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, oppsplicreate: maximum trigger depth exceeded Opportunity_Splits trigger event AfterInsert
  1.  Whenever an opportunity is created an opportunity split record should be created with the practice same as that of opportunity and percentage as 100. (If the practice is one)
  2. If there are two practices then whenever an opportunity is created two opportunity split records should be created with the practices same as that of opportunity and each with 50% share

Sum of the two should always be equal to 100%

trigger oppsplicreate on Opportunity_Splits__c(after delete, after insert, after update){

    set<Id> OpportunityIds = new set<Id>();
    List<Opportunity_Splits__c> opportunitySplitList = new List<Opportunity_Splits__c>();
    
    
    if(trigger.isInsert || trigger.isUpdate)
    {
        for(Opportunity_Splits__c p : trigger.new)
        {
            OpportunityIds.add(p.Opportunity__c);    
            opportunitySplitList.add(p);
            system.debug('-----opportunitySplitList--------'+opportunitySplitList);
        }
    }     
    List<Opportunity_Splits__c> lstCon = new List<Opportunity_Splits__c>();
    Opportunity oppt= [Select Id, Practiceu__c FROM Opportunity WHERE  id IN :OpportunityIds];
//    Opportunity oppt=[SELECT Name from Opportunity where Practiceu__cIN :multselect.split(';')
    system.debug('-----oppt--------'+oppt);
    String str = oppt.Practiceu__c ;
    system.debug('-----str --------'+str );
    if(str !=null)
    {
        List<String> lstValues = str.split(';');
        for(String pkValue: lstValues)
        {
            Opportunity_Splits__c con = new Opportunity_Splits__c(Opportunity__c = oppt.Id, Practice__c =pkValue);
            lstCon.add(con);    
        }
        insert lstCon;
}
}

@RestResource(urlMapping='/listRevenueProfile/*')

global with sharing class RESTRevenueprofileController {

@HttpGet
  global static List<Revenue_Profile__c> fetchRevenue()
  {    
     list<Revenue_Profile__c>lst1=new list<Revenue_Profile__c>();
   
   lst1=[Select Aug_17__c,Apr_17__c,January_2020_Sales_Updated__c,January_2021_Sales_Updated__c,July_2016_Sales_updated__c,July_2017_Sales_Updated__c,July_2018_Sales_Updated__c,July_2019_Sales_Updated__c,July_2020_Sales_Updated__c,June_2017_Sales_Updated__c,June_2018_Sales_Updated__c,June_2019_Sales_Updated__c,June_2020_Sales_Updated__c,June_2021_Sales_Updated__c,March_2017_Sales_Updated__c,March_2018_Sales_Updated__c ,
        March_2019_Sales_Updated__c,March_2020_Sales_Updated__c,March_2021_Sales_Updated__c,May_2017_Sales_Updated__c,May_2018_Sales_Updated__c,May_2019_Sales_Updated__c,May_2020_Sales_Updated__c,May_2021_Sales_Updated__c,November_2016_Sales_Updated__c,November_2017_Sales_Updated__c,November_2018__c,November_2019_Sales_Updated__c,November_2020_Sales_Updated__c,October_2016_Sales_Updated__c,October_2017_Sales_Updated__c,
        October_2018_Sales_Updated__c,Jun_19__c,Jun_20__c,Jun_21__c,Mar_17__c,Mar_18__c,Mar_19__c,Mar_20__c,Mar_21__c,May_17__c,May_18__c,May_19__c,May_20__c,May_21__c,Nov_16__c,Nov_17__c,Nov_18__c,Nov_19__c,Nov_20__c,Oct_16__c,Oct_17__c,Oct_18__c,Oct_19__c,Oct_20__c,Sep_16__c,Sep_17__c,Sep_18__c,Sep_19__c,Sep_20__c from Revenue_Profile__c WHERE CreatedDate >=2015-07-01T00:00:00Z];
    System.debug('----lst1----'+lst1);
    
    return lst1;
    
     list<Revenue_Profile__c>lst=new list<Revenue_Profile__c>();
   lst=[Select Opportunity_id__c,X18_Digit_Opportunity_ID__c,April_2017_Sales_Updated__c,April_2018_Sales_Updated__c,April_2019_Sales_Updated__c,April_2020_Sales_Updated__c,April_2021_Sales_Updated__c,August_2016_Sales_Updated__c,August_2017_Sales_Updated__c,August_2018_Sales_Updated__c,August_2019_Sales_Updated__c,August_2020_Sales_Updated__c,
        December_2016_Sales_Updated__c,December_2017_Sales_Updated__c,October_2019_Sales_Updated__c,October_2020_Sales_Updated__c,September_2016_Sales__c,September_2017_Sales_Updated__c,September_2018_Sales_Updated__c,September_2019_Sales_Updated__c,September_2020_Sales_Updated__c,Apr_18__c,Apr_19__c,Apr_20__c,Apr_21__c,Aug_16__c,Aug_18__c,Aug_19__c,Aug_20__c,Dec_16__c,Dec_17__c,Dec_18__c,Dec_19__c,Dec_20__c,Feb_17__c,Feb_18__c,     
        Feb_19__c,Feb_20__c,Feb_21__c,Jan_17__c,Jan_18__c,Jan_19__c,Jan_20__c,Jan_21__c,Jul_16__c,Jul_17__c,Jul_18__c,Jul_19__c,Jul_20__c,Jun_17__c,Jun_18__c,December_2018_Sales_Updated__c,December_2019_Sales_Updated__c,December_2020_Sales_Updated__c,February__c,February_2018_Sales_Updated__c,February_2019_Sales_Updated__c,February_2020_Sales_Updated__c,February_2021_Sales_Updated__c,January_2017_Sales_Updated__c,January_2018_Sales_Updated__c,January_2019_Sales_Updated__c from Revenue_Profile__c WHERE CreatedDate >=2015-07-01T00:00:00Z];
      System.debug('----lst----'+lst);
    return lst;
   
 } 
}
https://help.salesforce.com/articleView?id=000176969&type=1 (not work for me)
 
@RestResource(urlMapping='/listRevenueProfile/*')

global with sharing class RESTRevenueprofileController {

@HttpGet
  global static List<Revenue_Profile__c> fetchRevenue()
  {    
     list<Revenue_Profile__c>lst1=new list<Revenue_Profile__c>();
   
   lst1=[Select Aug_17__c,Apr_17__c,January_2020_Sales_Updated__c,January_2021_Sales_Updated__c,July_2016_Sales_updated__c,July_2017_Sales_Updated__c,July_2018_Sales_Updated__c,July_2019_Sales_Updated__c,July_2020_Sales_Updated__c,June_2017_Sales_Updated__c,June_2018_Sales_Updated__c,June_2019_Sales_Updated__c,June_2020_Sales_Updated__c,June_2021_Sales_Updated__c,March_2017_Sales_Updated__c,March_2018_Sales_Updated__c ,
        March_2019_Sales_Updated__c,March_2020_Sales_Updated__c,March_2021_Sales_Updated__c,May_2017_Sales_Updated__c,May_2018_Sales_Updated__c,May_2019_Sales_Updated__c,May_2020_Sales_Updated__c,May_2021_Sales_Updated__c,November_2016_Sales_Updated__c,November_2017_Sales_Updated__c,November_2018__c,November_2019_Sales_Updated__c,November_2020_Sales_Updated__c,October_2016_Sales_Updated__c,October_2017_Sales_Updated__c,
        October_2018_Sales_Updated__c,Jun_19__c,Jun_20__c,Jun_21__c,Mar_17__c,Mar_18__c,Mar_19__c,Mar_20__c,Mar_21__c,May_17__c,May_18__c,May_19__c,May_20__c,May_21__c,Nov_16__c,Nov_17__c,Nov_18__c,Nov_19__c,Nov_20__c,Oct_16__c,Oct_17__c,Oct_18__c,Oct_19__c,Oct_20__c,Sep_16__c,Sep_17__c,Sep_18__c,Sep_19__c,Sep_20__c from Revenue_Profile__c WHERE CreatedDate >=2015-07-01T00:00:00Z];
    System.debug('----lst1----'+lst1);
    
    return lst1;
    
     list<Revenue_Profile__c>lst=new list<Revenue_Profile__c>();
   lst=[Select Opportunity_id__c,X18_Digit_Opportunity_ID__c,April_2017_Sales_Updated__c,April_2018_Sales_Updated__c,April_2019_Sales_Updated__c,April_2020_Sales_Updated__c,April_2021_Sales_Updated__c,August_2016_Sales_Updated__c,August_2017_Sales_Updated__c,August_2018_Sales_Updated__c,August_2019_Sales_Updated__c,August_2020_Sales_Updated__c,
        December_2016_Sales_Updated__c,December_2017_Sales_Updated__c,October_2019_Sales_Updated__c,October_2020_Sales_Updated__c,September_2016_Sales__c,September_2017_Sales_Updated__c,September_2018_Sales_Updated__c,September_2019_Sales_Updated__c,September_2020_Sales_Updated__c,Apr_18__c,Apr_19__c,Apr_20__c,Apr_21__c,Aug_16__c,Aug_18__c,Aug_19__c,Aug_20__c,Dec_16__c,Dec_17__c,Dec_18__c,Dec_19__c,Dec_20__c,Feb_17__c,Feb_18__c,     
        Feb_19__c,Feb_20__c,Feb_21__c,Jan_17__c,Jan_18__c,Jan_19__c,Jan_20__c,Jan_21__c,Jul_16__c,Jul_17__c,Jul_18__c,Jul_19__c,Jul_20__c,Jun_17__c,Jun_18__c,December_2018_Sales_Updated__c,December_2019_Sales_Updated__c,December_2020_Sales_Updated__c,February__c,February_2018_Sales_Updated__c,February_2019_Sales_Updated__c,February_2020_Sales_Updated__c,February_2021_Sales_Updated__c,January_2017_Sales_Updated__c,January_2018_Sales_Updated__c,January_2019_Sales_Updated__c from Revenue_Profile__c WHERE CreatedDate >=2015-07-01T00:00:00Z];
      System.debug('----lst----'+lst);
    return lst;
   
 } 
}
https://help.salesforce.com/articleView?id=000176969&type=1 (not work for me)
 
getting error:Apex trigger TaskCreate caused an unexpected exception, contact your administrator: TaskCreate: execution of AfterInsert caused by: System.StringException: Invalid id: ABC: Trigger.TaskCreate: line 15, column 1

trigger TaskCreate on Task (after insert, after update){
    if(trigger.isAfter){
        if(trigger.isInsert || trigger.isUpdate){
            List<Task>Tasklist=new List<Task>();
            for(Task ts : trigger.new){
                if(ts.Status == 'Completed' ){
                    system.debug('ts.Status------'+ts.Status);
                    system.debug('tss------'+ts);
                    Task td = new task();
                    td.WhoId=ts.WhoId;
                    td.Status='Not Started';
                    td.Subject=ts.Next_Step__c;
                    td.ActivityDate=ts.Next_Step_Due_Date__c;
                    td.Inside_Sales_Reps__c=ts.Inside_Sales_Reps__c;      
                    td.OwnerId=ts.Next_Step_Owner__c;            
                    Tasklist.add(td);
                    system.debug('Tasklist------'+Tasklist);
                } 
            }if(Tasklist.size()>0){
                try{
                    insert Tasklist;
                }
                catch(exception e){
                    system.debug('---e---'+e);
                }
            }            
        }
    }    
}
if(oppList.size()>0){
               for(Opportunity opp : oppList){
                   if(opp.StageName== '100% - Closed Won'){                    
                       Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();
                       message.toAddresses = new String[] {'sh@gmail.com'};
                       message.optOutPolicy = 'FILTER';
                       message.setSubject(' New attachment on Opportunity : ' + '  ' + opp .name+'    ' +'with probability 100% for Account'+'  ' + opp.Account.Name);
                       message.setHtmlBody ('Hi Team, <br/><br/> There is a new attachment for opportunity '+opp .name+'  Please review the attached document<br/><br/><a href=&#34;https://c3.salesforce.com/'+opp.id+'&#34;>https://c3.salesforce.com/'+opp.id+'</a><br/><br/>Regards<br/><br/>Salesforce Admin');
              
                      for(Attachment a : trigger.new){
                           if(a.parentId == opp.id){
                                Messaging.Emailfileattachment efa = new Messaging.Emailfileattachment();
                                efa.setFileName(a.Name);
                                efa.setBody(a.Body);
                                efa.setContentType(a.ContentType);
                                fileAttachments.add(efa);
                          }
                      }
                          if(!fileAttachments.isEmpty()){
                                Message.setFileAttachments(fileAttachments);
                                Messaging.sendEmail(new Messaging.SingleEmailMessage[] {message });
                          }
Trying below code but getting error :
Apex trigger oppsplicreate caused an unexpected exception, contact your administrator: oppsplicreate: execution of AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, oppsplicreate: maximum trigger depth exceeded Opportunity_Splits trigger event AfterInsert
  1.  Whenever an opportunity is created an opportunity split record should be created with the practice same as that of opportunity and percentage as 100. (If the practice is one)
  2. If there are two practices then whenever an opportunity is created two opportunity split records should be created with the practices same as that of opportunity and each with 50% share

Sum of the two should always be equal to 100%

trigger oppsplicreate on Opportunity_Splits__c(after delete, after insert, after update){

    set<Id> OpportunityIds = new set<Id>();
    List<Opportunity_Splits__c> opportunitySplitList = new List<Opportunity_Splits__c>();
    
    
    if(trigger.isInsert || trigger.isUpdate)
    {
        for(Opportunity_Splits__c p : trigger.new)
        {
            OpportunityIds.add(p.Opportunity__c);    
            opportunitySplitList.add(p);
            system.debug('-----opportunitySplitList--------'+opportunitySplitList);
        }
    }     
    List<Opportunity_Splits__c> lstCon = new List<Opportunity_Splits__c>();
    Opportunity oppt= [Select Id, Practiceu__c FROM Opportunity WHERE  id IN :OpportunityIds];
//    Opportunity oppt=[SELECT Name from Opportunity where Practiceu__cIN :multselect.split(';')
    system.debug('-----oppt--------'+oppt);
    String str = oppt.Practiceu__c ;
    system.debug('-----str --------'+str );
    if(str !=null)
    {
        List<String> lstValues = str.split(';');
        for(String pkValue: lstValues)
        {
            Opportunity_Splits__c con = new Opportunity_Splits__c(Opportunity__c = oppt.Id, Practice__c =pkValue);
            lstCon.add(con);    
        }
        insert lstCon;
}
}

@RestResource(urlMapping='/listRevenueProfile/*')

global with sharing class RESTRevenueprofileController {

@HttpGet
  global static List<Revenue_Profile__c> fetchRevenue()
  {    
     list<Revenue_Profile__c>lst1=new list<Revenue_Profile__c>();
   
   lst1=[Select Aug_17__c,Apr_17__c,January_2020_Sales_Updated__c,January_2021_Sales_Updated__c,July_2016_Sales_updated__c,July_2017_Sales_Updated__c,July_2018_Sales_Updated__c,July_2019_Sales_Updated__c,July_2020_Sales_Updated__c,June_2017_Sales_Updated__c,June_2018_Sales_Updated__c,June_2019_Sales_Updated__c,June_2020_Sales_Updated__c,June_2021_Sales_Updated__c,March_2017_Sales_Updated__c,March_2018_Sales_Updated__c ,
        March_2019_Sales_Updated__c,March_2020_Sales_Updated__c,March_2021_Sales_Updated__c,May_2017_Sales_Updated__c,May_2018_Sales_Updated__c,May_2019_Sales_Updated__c,May_2020_Sales_Updated__c,May_2021_Sales_Updated__c,November_2016_Sales_Updated__c,November_2017_Sales_Updated__c,November_2018__c,November_2019_Sales_Updated__c,November_2020_Sales_Updated__c,October_2016_Sales_Updated__c,October_2017_Sales_Updated__c,
        October_2018_Sales_Updated__c,Jun_19__c,Jun_20__c,Jun_21__c,Mar_17__c,Mar_18__c,Mar_19__c,Mar_20__c,Mar_21__c,May_17__c,May_18__c,May_19__c,May_20__c,May_21__c,Nov_16__c,Nov_17__c,Nov_18__c,Nov_19__c,Nov_20__c,Oct_16__c,Oct_17__c,Oct_18__c,Oct_19__c,Oct_20__c,Sep_16__c,Sep_17__c,Sep_18__c,Sep_19__c,Sep_20__c from Revenue_Profile__c WHERE CreatedDate >=2015-07-01T00:00:00Z];
    System.debug('----lst1----'+lst1);
    
    return lst1;
    
     list<Revenue_Profile__c>lst=new list<Revenue_Profile__c>();
   lst=[Select Opportunity_id__c,X18_Digit_Opportunity_ID__c,April_2017_Sales_Updated__c,April_2018_Sales_Updated__c,April_2019_Sales_Updated__c,April_2020_Sales_Updated__c,April_2021_Sales_Updated__c,August_2016_Sales_Updated__c,August_2017_Sales_Updated__c,August_2018_Sales_Updated__c,August_2019_Sales_Updated__c,August_2020_Sales_Updated__c,
        December_2016_Sales_Updated__c,December_2017_Sales_Updated__c,October_2019_Sales_Updated__c,October_2020_Sales_Updated__c,September_2016_Sales__c,September_2017_Sales_Updated__c,September_2018_Sales_Updated__c,September_2019_Sales_Updated__c,September_2020_Sales_Updated__c,Apr_18__c,Apr_19__c,Apr_20__c,Apr_21__c,Aug_16__c,Aug_18__c,Aug_19__c,Aug_20__c,Dec_16__c,Dec_17__c,Dec_18__c,Dec_19__c,Dec_20__c,Feb_17__c,Feb_18__c,     
        Feb_19__c,Feb_20__c,Feb_21__c,Jan_17__c,Jan_18__c,Jan_19__c,Jan_20__c,Jan_21__c,Jul_16__c,Jul_17__c,Jul_18__c,Jul_19__c,Jul_20__c,Jun_17__c,Jun_18__c,December_2018_Sales_Updated__c,December_2019_Sales_Updated__c,December_2020_Sales_Updated__c,February__c,February_2018_Sales_Updated__c,February_2019_Sales_Updated__c,February_2020_Sales_Updated__c,February_2021_Sales_Updated__c,January_2017_Sales_Updated__c,January_2018_Sales_Updated__c,January_2019_Sales_Updated__c from Revenue_Profile__c WHERE CreatedDate >=2015-07-01T00:00:00Z];
      System.debug('----lst----'+lst);
    return lst;
   
 } 
}
https://help.salesforce.com/articleView?id=000176969&type=1 (not work for me)