+ Start a Discussion
Hemalatha  ParuchuriHemalatha Paruchuri 

In case object I created two fields current time(text),time slice(text), when ever i created new case in time between 1:00 to 1:10 time slice display=1.05 using before insert trigger

This my code
trigger Casetimetrigger on Case (before insert) {
    
  list<Case>caslist1 = [Select Id From Case Where createdDate = Today];
   for(Case cac:trigger.new){
   system.debug('before trigger.cac==>'+cac);
    system.debug(system.now());
       if(cac.Id!=null){
           if(cac.Current_Time__c  = CreatedDate) {
Time_Slice__c : = CreatedDate

}else 
{ Current_Time__c > CreatedDate
    }
 Time_Slice__c = CreatedDate

    }
  }