Is there a way to query all records of all object types changed since a given date? SOQL doesn't appear to have a way to do this. I thought that the "From" clause might have a way, but when I tried adding a second object onto the query as shown in the SOQL guide:

FROM objectType[,objectType...][USING [SCOPE filterScope]]

I got the following:

A driving SObject type has already been set, all other entity types in the FROM clause must be relationships to the initial object. The driving object is Contact.

SOSL will let you search for specific text within multiple objects, but there doesn't seem be be a way to omit the SearchQuery.

It appears that what I want to do isn't possible, at least with SOQL or SOSL, unless I do one SOQL query per object type.

1 Answer 1


Yes SOQL always references concrete SObject types.

But given the ability to find out all the SObject types, the availability of dynamic SOQL and the Batchable mechanism to avoid hitting the "Total number of SOQL queries issued" and "Total number of records retrieved by SOQL queries" governor limits, a solution should be possible in not too many lines of code.

  • I thought I might be overlooking something. Finding out the SObject types was that thing.
    – Jagular
    Nov 20, 2014 at 21:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .