Service Desk Practitioners Forum
Showing results for 
Search instead for 
Did you mean: 

Addition of 8 Counters

Senior Member

Addition of 8 Counters

We are using SD 4.5 with SP19.
Customer has to select 8 checkboxs dependsupon category.
Whwn customer select any checkbox out of 8 (say only 1 0r any 2 or any 3 or any 4 or any 5 or any 6 or any 7 or any 8) then depends upon selection its values should save in custom filed.
I have created 8 custom counters for 8 checkboxes & another one for total counter.
When customer select induvdually checkbox, its value stored in respective counter.(done by 8 db rules)
At the end, I want to add this counters & its value should display in total counter.
When I have checked updata db rule, I can add maximum 2 counters only at do I add more than 2 counters in rule.

Has any one done this before.
Looking for some suggestions/ examples.
George M. Meneg
Honored Contributor

Re: Addition of 8 Counters

Hello Sean,

If you want to add three counters, eg counter1,counter2 and counter3 and store the value to another field, let's say result do the following:

result set to ( [counter1] + ( [counter2] + [counter3]))

That means that instead of adding two fields you add the the first field the function (sum of the other fields).

The same works for any number of fields. Have in mind that all counter fields must be initialized (that is NOT NULL) or you may get unexpected results.
menes fhtagn
//Add this to "OnDomLoad" event