1

Wanted to get the opinion of the community on this one. We currently have a formula field (products_purchased__c) that displays a list of products that have been bought by a customer. We have another field that is a multi-select picklist (products_green__c) where our reps can check the boxes of products that the customer is happy with. I was tasked with creating another field which should automatically populate with products purchased subtract products green. This new field (products_red__c) will show what products the customers are unhappy with. I'm sure there is a better way to build this from scratch, but products_purchased__c and products_green__c are already integrated.

Would a trigger be the best way to solve for this? I can't see this being done with an advanced formula.

Example:

Products purchased: product1; product2; product3

Products Green: product1; product3

(New Field)Products Red: product2

2

The only way you're going to get this list easily is with a trigger. There's no way a formula could handle anything more than a trivial amount of values, and the process builder/flow system, as far as I'm aware, could do it, but it would be painful at best. I'd seriously recommend just writing a trigger, which would probably be about 9 lines of code in total, maybe 10 minutes worth of work, rather than messing around with a flow or trying to fit a formula within the compilation limits.

  • Thanks for the tip, Brian. This will save me a lot of time from messing with formulas – Andrew Aug 4 '16 at 15:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.