+ Start a Discussion
krish4ukrish4u 

how to know the apex class name based on batch job id in batch apex

 Hi Folks,

 

How to get the Apex class name of the batch job id in batch apex. can any one suggest me. this is very urgent..............pleaseeeee......................

 

thanks

krish

Santosh KumbarSantosh Kumbar

Krish4u,

 

You can get apex class Id from AsyncApexJob:

 from below query : a.ApexClassID

 

AsyncApexJob a = [SELECT Id, Status, ApexClassID,NumberOfErrors, JobItemsProcessed,
      TotalJobItems, CreatedBy.Email
      FROM AsyncApexJob WHERE Id =
      :BC.getJobId()];

Regards

Santosh