FOR VIEW in SOQL

FOR VIEW is used to notify Salesforce when a record is viewed. The LastViewedDate field is updated for any retrieved records.

Sample Query:

SELECT City__c, State__c, LastViewedDate FROM Employee__c FOR VIEW

If we execute the above query, for the first time, it shows the lastly viewed date of the record in LastViewedDate. But for the second time, all the records will show the same date and time (date and time when we executed the query for the first time) for LastViewedDate.

Cheers!!!

No comments:

Post a Comment