Skip to main content
Nintex Community Menu Bar
Solved

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

  • June 27, 2024
  • 3 replies
  • 1 view

Forum|alt.badge.img+1

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?

Best answer by jforeman3211

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.

Thanks!
Jack

3 replies

Forum|alt.badge.img+1

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?


Forum|alt.badge.img+1
  • Author
  • New Participant
  • Answer
  • June 27, 2024

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.

Thanks!
Jack


Forum|alt.badge.img+1

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

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