Skip to main content
Is there any possibility to track down the users who looked at particular records...clients requirement data is very confidential so they are expecting if there is any posibility to know every user who looked into a record
3 Antworten
  1. 23. Mai 2016, 21:10
    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 object

    E.g.: If I am trying to track users who viewed Account.

    Create an object AccountViews. Create 2 lookup fields to Account and User

    Create an apex extension class  with the following method 

     

    public 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');

    }

    }

    Add this line to VF Page

    <apex:page StandardController="Account" extensions="AccountExtension" action="{!trackViews}">

    Don't forget to give create permissions to all the users
0/9000