답변 3개
If you are trying to track all the users who viewed a file, I would create an object and store the record viewers in that objectE.g.: If I am trying to track users who viewed Account.Create an object AccountViews. Create 2 lookup fields to Account and UserCreate an apex extension class with the following method
Add this line to VF Page<apex:page StandardController="Account" extensions="AccountExtension" action="{!trackViews}">Don't forget to give create permissions to all the userspublic void trackViews(){
AccountViews av= new AccountViews(Account__c=acc.Id, ViewedBy=UserInfo.getUserId());
try{
insert av;
}catch(DmlException e){
System.debug('Account viewer record not created');
}
}