• Alejandro Rosano
  • NEWBIE
  • 20 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 0
    Replies
I am calling a batch through a system.scheduleBatch(BatchableClass(query), 'Job Name', MinutesToExecute) method. How can I check if the batch job Job Name is already scheduled?

Thanks in advance.
Hello all,

I made a schedulable batch that I want to run at certain hours, let's say 6, 12 and 18. I'm writting those hours in a custom setting CS_Schedule__c. How can I call that CS from Apex and get the hours?

Thanks in advance.
global class ClassName implements Database.Batchable<sObject> {
    global final string query;
    
    global UpdateUserBloombergFields (string q) {
             query=q;
    }
    
    global Database.QueryLocator start (Database.BatchableContext BC) {
        return Database.getQueryLocator(query);
    }
    
    global void execute (Database.BatchableContext BC, List<User> scope) {
        List<User> UserList = new List<User>();
        for (User u: scope) {
            UserList.add(u);
        }
    }
    
    global void finish (Database.BatchableContext BC){}
}
I would like to return the list UserList so I can use it after in any other class. Is it possible?

Thanks and kind regards.
Hello,
 

I'm quite new in Apex and no experience at all with batches so any kind of help would be great.

I have the standard object User, with two custom fields User.FA__c (text) and User.FB__c (checkbox).

I need to recover the field FA__c for all the users in the org that have the field FB__c = true.

I've been reading about Using Batch Apex but still not so clear about how to use the start, execute and finish methods.

Thanks in advance and kind regards.