0

I have about 8 picklists, half of them have values of 0 or 0.5 and the other 0 or 1 or 2. I'm trying to develop a button that will add all the values of these picklists together (picklist + picklist + picklist) and then add that total value to a text area.

It's basically an audit system where the manager will enter the score in the picklist and wants to view the total points to see if the user passed.

Any help going about this is appreciated, I'm very new to this side of Salesforce.

1
  • if you can share what you have tried so far, it will be easy for people to suggest what can be changed / improved.. Nov 6, 2014 at 0:43

2 Answers 2

2

You should have a look to Salesforce Documentation at this page: https://help.salesforce.com/apex/HTViewHelpDoc?id=customize_formulas.htm

What you need to create is a Formula Field on that object.

In this way, provided the formula is correct, your User will be able to see the sum (or average) of the different picklist values on a given record after having edited and saved the picklist values.

If your intention is to have the sum/average calculated on the User Interface while the User is editing (before save), then you have to talk to a Developer because that requires code to be developed.

HINT: Even though your picklists values consist of numbers, they are considered as special fields and anyway as strings/text in Formulas. Wrap the field API Name inside a VALUE() function when using them in Formula, to ensure they are converted to their numerical values when evaluated.

1

Two options here - first is the user selects scores and hits save, whereupon the page refreshes and a result is displayed - this is solved as @ernestocapra suggests using formula field and the standard user interface - no code or visualforce required.

Second route is that you're wanting the user to see the calculation happening as they select values in the picklist fields, without the page refreshing. If so, then this is not a capability of the standard user interface, and you'd need to setup a visualforce page to achieve this. The page would have the picklist fields within it, and you'd use apex:actionsupport tags and accompanying logic to fire a recalculation and update of the result text area. Given you're new to Salesforce and that the use case doesnt appear to need to deliver instant feedback to the user, scenario 1 seems the better choice.

Have fun!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .