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?

  • 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? – Jeremy Nottingham Jun 21 '13 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 Jun 21 '13 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 – Andrew Fawcett Jan 3 '14 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. – Willem Mulder Sep 19 '16 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 Sep 19 '16 at 15:30
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.

  • agreed that rebuilding the project would likely solve this issue; – cropredy Jun 24 '13 at 18:48
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+

  • thanks; I resolved by doing crmprogdev suggestion but this is helpful for future problems should they occur – cropredy Jan 3 '14 at 17:56
6

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.