AnsweredAssumed Answered

How to write sugar logic for assigning value to list items

Question asked by Jeffrey White on Feb 25, 2020
Latest reply on Feb 27, 2020 by Jeffrey White

Our company has determined there are 6 levels of contacts we need to make within each customer. We'd like a way to easily see which levels have been reached (via Contact creation). In preparation a dropdown field was added to the Contacts Module with each of the 6 categories of people (Contact Purpose). For viewing how many levels of people we've reached and as opposed to taking up multiple columns on the Accounts grid I would like just 1 field to showcase the status.

 

My thought was to create a 7-digit field where each place value would represent one of our 6 contact levels (there would not be more than 9 people in each level). Each of the Contact Purpose categories would be assigned a value which would update the 7-digit value shown on the Accounts grid.

 

Contact Purpose Values:
Accounting Decisions = 10
Damage Decisions = 100
Specialty Decisions = 1,000
Claims Decisions = 10,000
Contract Management = 100,000
Executive Level = 1,000,000

 

If the Account had 2 Executive & 1 Contract person & 0 Claims persons & 2 Specialty persons & 0 Damage & 5 Accounting.... then the field would total 2,102,050.
If the account had 0 Executive & 0 Contract person & 5 Claims persons & 7 Specialty persons & 2 Damage & 0 Accounting.... then the field would total 57,200

 

We could keep the 1's value open for a future need.

 

How could this CASE statement or other logic be written into Sugar... or is there a more mainstream idea for determining levels of contacts? We already have a field that counts the number of contacts and shows the value on the Accounts grid. This is unhelpful as there can be 100's or 1000's of contacts in an account with the vast majority not falling into a main category (like entry-level support people).   

 

Any help is appreciated.

Outcomes