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
pooja chauchanpooja chauchan 

Batchable Class Query

Best Answer chosen by pooja chauchan
Gaurav NirwalGaurav Nirwal

As I see the code It appears to me that field StudentID__c on is Text field not a reference field (Lookup or Master detail) . I think you should make it Lookup in case if it is text field.

If you need to have it as text then you have to creae a
Set<String> setSturdentIds = new Set<String>();
and loop over scope and fill it. Then use it this query

List<Address1__c> adrToUpdate = [Select id,StudentID__c,City__c from Address1__c where StudentID__c in : setSturdentIds ]

Let me know if it does not solve your problem.