Tag: Apex
-
Eclipse/Class save error – This Apex class has batch or future jobs pending or in progress
I was constantly getting an error “This Apex class has batch or future jobs pending or in progress” whenever I was saving Apex class written for batch Apex. This was happening in the developer org where we develop a test managed package for the AppExchange product. There was no way I can throw out this…
-
Salesforce: Adding specific working days to a Date
UPDATE: If you want to consider holidays and business hours you can check out this article. Many time while coding we come across the requirement in which we need to calculate the EndDate from a StartDate after a specific number of business/working days. That means excluding the weekends (Saturday & Sunday) Following is the code snippet which does…
-
Salesforce : Converting DateTime to format YYYY-MM-DDThh:mm:ssZ
I spend lots of my time finding a solution for converting the datetime into the format (YYYY-MM-DDThh:mm:ssZ) so that it can be used in SOQL query. SOSL query returns the datetime in format(YYYY-MM-DDThh:mm:ssZ) so for comparison one need to convert it into that format. System.debug(DateTime.now().format(‘yyyy-MM-dd\’T\’hh:mm:ss\’z\”)); I hope this will save your time. 🙂