We always get an error when we try to query LastViewedDate field on an object whose tab has not been created yet. As soon as we create a tab, the error goes away.

Just outta curiosity -

Is it like Salesforce keeps this field as disabled till an object's tab is created or something else is happening. Any ideas ?

1 Answer 1


LastViewedDate is stored as part of the tab. Its importance is not in data analysis by developers, but providing meaningful subsets of records in the UI, per user. See also sfdcfox's answer here.

  • 1
    In the broader scheme of things, this is true for many "standard" fields, such as Contact Middle Name or CurrencyIsoCode. If you don't have the feature enabled, all queries will treat that field as if it does not exist.
    – sfdcfox
    Commented Mar 20, 2022 at 22:26
  • Hey @Felix van Hove, I was just curious how salesforce is managing this thing that till we do not create a tab LastViewedDate cannot be queried. By the way, thanks for your input :)
    – HG_
    Commented Mar 21, 2022 at 14:01

You must log in to answer this question.

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