byId
Add a condition to the query, filtering the result by a specific ID or a collection of ID. Alias to addConditionEq('Id', ...)
public Query byId(Id id)
id: The specified ID of the SObject
Query query =
new Query('Account').
byId();
public Query byId(List idList)
idList: A List of specified IDs
Query query =
new Query('Account').
byId(new List{'001O000000qkv3KIAQ'});
public Query byId(Set idSet)
idSet: A Set of specified IDs
Query query =
new Query('Account').
byId(new Set{'001O000000qkv3KIAQ'});