Is it possible to query records where the LastModifiedDate is more recent than LastViewedDate?

Use case: Users need to be aware of the records that have recently been updated, but once they view the record, the record is no longer needed in the model (ie. show records with unseen updates).

I would like to query records where the LastModifiedDate is more recent than the LastViewedDate. Is this possible?

Hey @jforeman3211, welcome to the Skuid community!

I think the best way to accomplish this is to create a formula field on the Salesforce object itself, for example a checkbox that returns true if LastModifiedDate > LastViewedDate.

Then you could set up the conditions on your Skuid model to return all records where this formula field is true.

Alternately, you could set this up as a UI-Only formula field in Skuid and use it to highlight these records from a wider list or to filter the model (client-side since the formula field wouldn’t exist in the database).

Is this helpful?

Anna, Thanks for the advice.

I just tried to create a formula field on the object, but it does not seem possible since the fields LastModifiedBy and LastViewedBy are SFDC System Fields. They do not appear in the dropdown list of fields when creating the formula.

So I will just include the UI-Only field on a table. Not an ideal solution, but should suffice.


1 Like

Thanks! I assumed they were both “normal” fields on the object without actually verifying. :see_no_evil:

For posterity, looks like LastModifiedDate is accessible in custom Salesforce formula fields but LastViewedDate is not.