function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
krishna chaitanya 35krishna chaitanya 35 

route cases to queue(Batch Class)


HI,

Can any one help me to write logic for this:
Two conditions in  user obj the  out of office must be true  true and case last modified date 1 week then route the cases to  queue ..

Thanks,
krishna.
krishna chaitanya 35krishna chaitanya 35
HI ,

I developed the code for last n day,but i need condition for out of office from user:
global class SchedulelmdCase implements Schedulable
{
   global void execute(SchedulableContext SC)
   {
        try
        {
            List<case> cslst = new List<case>();
            List<case> cslst1 = new List<case>();
            cslst=[Select Id,casenumber from case where SystemModStamp >= LAST_N_DAYS:7 Limit 10000];
            
            for(case cs:cslst){
                
                cs.ownerid='00G28000000Rs9y';
                cslst1.add(cs);
                
            }
            
            update cslst1;
        }
        
        catch (Exception e)
        {
            system.debug('__________Exception inClass ___________________'+e);
        }
   }
}

Thanks,
Krishna.
rajat Maheshwari 6rajat Maheshwari 6

Hi Krishna,

I would help you to build the logic as per your requirement. Please share your requirement in detailed manner.

Thanks
Rajat Maheshwari
rajatzmaheshwari@gmail.com