2

I have the following recordEditForm component which does not use LastViewedDate:

<aura:component description="ErrorTesting" implements="flexipage:availableForAllPageTypes" access="global">
<lightning:recordEditForm objectApiName="TestChild__c">
    <lightning:messages/>
    <lightning:inputField label="TestMaster" fieldName = "TestMaster__c"/>
    <lightning:button variant="brand" type="submit" name="save" label="Save" />
</lightning:recordEditForm>

However, when the component is saved, the following error message appears:

INVALID_FIELD: LastViewedDate != null ORDER BY LastViewedDate DESC LIMIT 6 OFFSET ^ ERROR at Row:1:Column:90 No such column 'LastViewedDate' on entity 'TestMaster__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

enter image description here

Any insight as to why I would get this error even though I'm not referencing this field would be helpful. It may be useful to note that "TestMaster__c" is a master-detail field.

3

I've added Tab for the Custom Object and in that case LastViewedDate appeared on the object. It seems that Salesforce restricts access to LastViewedDate if there is no Tab on the object

  • Were you able to handle this without Custom tab ? describe is giving back LastViewedDate in our manage package when there is no tab. – Sriram Jan 24 '19 at 17:22
  • 1
    No I wasnt' able to fix it without custom tab. Probably you can try create tab after package is installed with jsforce. so it not shown to business users – pklochkov Jan 25 '19 at 6:57

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.