• Alex levy 3
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I want to query all fields in the start method of the batch class. Below is my code which is giving error(also giving error on type casting). Can you please suggest if there is any way to achieve this?
global class BatchClass implements Database.Batchable<sObject> {
    global Database.QueryLocator start(Database.BatchableContext BC) { 
    Map<String, Schema.SObjectField> CaseMap = Case.sObjectType.getDescribe().fields.getMap();        
    Set<String> setFieldNames = CaseMap.keySet();
    list<String> lstFieldNames = new List<String>(setFieldNames);                
    String query = Database.query('SELECT ' + String.join(lstFieldNames, ',') + ' FROM Case limit 2');
    return Database.getQueryLocator(query);
    }
}
 
Hi, we are looking for a London based Salefsforce developer/architect who can help us to connect a sign up form on Craft CMS (created by someone else) with Salesforce. Our aim is to create/update contacts and accounts and to create new campaign members.
Thank you