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
DEV_CGDEV_CG 

constructor calling from batch

hi everyone,
kindly see code provided in this link.
https://developer.salesforce.com/forums/?id=9060G0000005sp4QAA

In this what would the value of Query?
what would be value of records in Scope?
Actully am querying from different objects...which will take fisrt if both queries fetched the records.
could anyone explain?
your help would be appreciated
Raj VakatiRaj Vakati
The query will be based on how you are calling the batch by using the constructor 
Id batchInstanceId = Database.executeBatch(new DemoBatch(), 5)===>> Query will be 

Query='select accountid,Account.name from Contact where account.closeddate=today and createdate=today'

what would be the scope records...are they related to query1/query2 
batchInstanceId1= Database.executeBatch(new DemoBatch('select id,name,email from Account where createddate=today'), 5)===> Query will be 
'select id,name,email from Account where createddate=today')

Your scope will be the list of account  which you query will be returned and you are seeing the values to 5