New answers tagged

2

You would need to enable 'Track Field History checkbox' under object settings. Select Object Manager--> Click the custom object (Teacher__c) and click Edit--->Under Optional Features, select the Track Field History checkbox. Later add Custom object History (Teacher__c) related list on the detail page or you can run above query to check 'New Value' ...


-1

Please check if you have enable the same field for field history tracking 1 From Setup, click Object Manager and select Teacher__c 2 Select Fields & Relationships, and click Set History Tracking. 3 Select Enable Teacher History, then select these two fields to track: teacher_name__c 4 Click Save.


3

Bind variables e.g. :kesIds are a good way to go because they leave the type conversion formatting up to the framework and in the process also eliminate the SOQL injection risk. And make your code simpler and much easier to read. But the variable must be in scope - visible to the code - at the point that Database.query executes as illustrated in Rijwandeltax'...


0

Set<ID> accId = new Set<ID>(); accId.add('0016F00002QHh3E'); String query = 'Select id from Account Where ID IN :accId'; for(Account acc : Database.query(query)){ System.debug('acc=>'+acc); } Its working for me You only need to set keyids variable global variable


2

Best to use bind variables instead so there is no need to format various types and avoids the SOQL injection security risk. That is possible in dynamic as well as static SOQL, though in dynamic the variables have to be simple (no dotted expressions). But your SOQL can be implemented as static SOQL so you get the benefit of compiler checking and explicit ...


Top 50 recent answers are included