function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
hector.asp2hector.asp2 

Custom Settings to save user click count

Hi All,

I wanted to save user clicks count on one particular button, and am thinking of custome settings. My need is very simple, a simple integer to save how many times a particular page was called etc... The count starts from 0 and only goes up to 5.

The examples is see for custome settings do not cover such a simple scenario..

Plus I need to be able to access that variable thru both apex and ajax.

 

Please guide

 

Thanks

Hector....

 

pbattissonpbattisson

Hey Hector

 

The solution to your problem is to add an apex function that is called by your button which does one of the follwoing depending upon your situation:

 

1) if you are counting up to 5 for a particular user only to then perform some action (e.g. 5 clicks then display something else) then you could just keep this variable in the controller. 

 

2) If you are attempting to store this variable for retrieval later then you can get the custom setting value, increment it and then save it

 

Why are you trying to save this count? Knowing that will allow better advice to be given.

 

Paul