6

This is a bit odd.

  • Sandbox org created under V27.0
  • Sandbox org now upgraded to V28.0 a few weeks back
  • VF page at V28.0 that interacts with a controller at V27.0 that updates custom object Quote__c
  • Today (this didn't happen yesterday), when page attempts to update the Quote__c obj via the controller, I get error: No such column 'lastvieweddate' on entity 'Quote__c

I realize that lastvieweddate was added in V28.0;

  • If I downgrade the VF page back to V27.0, the error goes away and Quote__c is saved

Short of rebuilding my sandbox org as V28.0, how does one update a custom object to V28.0 and thus get the new field lastvieweddate so this error doesn't happen? And shouldn't SFDC have made this change backward compatible?

6
  • 1
    Are you sure it isn't because the VF page and controller are on different versions? Maybe if they were both V28 it would work? Commented Jun 21, 2013 at 18:56
  • Interesting thought but .. VF page(28) controller(27) - fails; VF page(28) controller (28) - fails; VF page (27) controller (27) passes; VF page(27) controller (28) passes.
    – cropredy
    Commented Jun 21, 2013 at 23:11
  • There is a known issue recently raised that relates to this field and i suspect related to this question... success.salesforce.com/issues_view?id=a1p30000000T0tvAAC Commented Jan 3, 2014 at 10:56
  • @cropredy The problem is with Salesforce, but a workaround is to ensure that you have a tab for the Quote__c object. Once you have a Tab (even if it's hidden) the problem should go away. Commented Sep 19, 2016 at 7:25
  • @WillemMulder - thanks for adding this bit; problem is no longer relevant to me as I've long since moved up to V37 but this could help others
    – cropredy
    Commented Sep 19, 2016 at 15:30

3 Answers 3

2

Check and see if there are updates waiting to be applied to your Sandbox. And "no", SF shouldn't be making changes to your Sandbox until you ask them to. Why? They could totally kill any work in progress you have going until you're ready for those changes to be made to your Sandbox.

I recommend you save all you have in Eclipse, upgrade your Sandbox, then restart your project. After you have a new sandbox, you can easily copy over anything you've done into the new project. You could also selectively update the metadata on your objects. Were it me, to be safe, I'd start a new project.

1
  • agreed that rebuilding the project would likely solve this issue;
    – cropredy
    Commented Jun 24, 2013 at 18:48
9

We had this problem too. Interestingly, the problem did NOT occur in our sandbox but it did occur in Production.

It turns out that we had deleted the tab for the custom object which was being queried. The tab was not necessary because we had created our own custom Visualforce tab. However, deleting the tab causes some backend change to Salesforce where the LastViewedDate field is no longer accessible. We recreated the tab as hidden and the problem was resolved.

This is not a good solution for us because the tab takes away from our total tab allocation so we are still looking for Salesforce to fix this bug.

1
  • I actually just had this same issue with API version 46 and the tab recreation worked! Commented Jun 9, 2020 at 15:22
7

There is a known issue that has been raised recently that appears to relate to this problem. There is a known issue recently raised that relates to this field and i suspect related to this question... When performing several SOQL queries from different Apex classes, "No such column 'LastViewedDate' on entity " is thrown. Status is IN REVIEW.strong text

When performing several SOQL queries from different Apex classes, "No such column 'LastViewedDate' on entity " is thrown from an Apex class with API version 28.0+

2
  • thanks; I resolved by doing crmprogdev suggestion but this is helpful for future problems should they occur
    – cropredy
    Commented Jan 3, 2014 at 17:56
  • Salesforce is fixing this Known Issue with the Enable Improved Caching of Org Schema critical update on or before Aug 12, 2020 Commented May 29, 2020 at 16:07

You must log in to answer this question.

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