Hi We have two fields created for reporting and administrtion purpose.
We track how many time a user is visiting the record and updating the 1st field Product_Book_View_Count__c,
Secondly we try to check how many time a user prints a VF page which is a PDF rendered. I have tried to implement both but first one worked as expected but the second one does not update the count rather it will take me to the vf page.
Please find the code snippet below.
when I go into salesforce record detail page automatically it goes to the to the pdf even before I click on the PDF export custom lightning button.