1

Our org has a multi select pick list that we use to select different business . after the business have been selected, we write down a comment for each business selected. User have been complaining that its to tedious to retype in each business name and then write a comment. I am looking for ideas where I can auto populate the comment field with all the values that were selected in a picklist. I came across someone mention triggers but thats something I have no knowledge of.

3
  • you can use a formula field to populate the comment field with value selected in the multi picklist. But the the formula field is read only and cannot be editable. If you want the comment to be editable, you might have to consider using a workflow rule with a field update to update comment with multi select picklist field.
    – Anurag
    Aug 15, 2016 at 18:32
  • Thanks for the quick response Anurag. Would the workflow only work once the page is saved ? then go back to the task page and enter in the comment.
    – pmehra
    Aug 15, 2016 at 18:34
  • yes, it is done when page is saved. you can go edit the page after saving
    – Anurag
    Aug 15, 2016 at 20:48

3 Answers 3

0

You could do the following in a field update for Comment__c

value would be set to
             IF(INCLUDES(MSP__c,'BusinessA'),'Business A: <your notes here>',NULL) &
             IF(INCLUDES(MSP__c,'BusinessB'),'Business B: <your notes here>',NULL) &
             ...
             IF(INCLUDES(MSP__c,'BusinessZ'),'Business Z: <your notes here>',NULL)

where the result would be a text field that would look like (say Business C and Business E were chosen by user):

Business C: <your notes here> Business E: <your notes here>

and user could move the cursor to add in comments after each relevant business.

The above will break down if you have many MSP values as the formula will get too large - in that case, a trigger will be the best bet

0

You can create a custom metadata which will hold the mapping of Business Name to Comment for each one of them, this will be easily maintained by Admins in the Org. One to One mapping of Bussiness Name to Comment

The trigger on the Object you are working on can then query this metadata and get all the comments for the Business Name entered in the object, then get the comments for selected Business Name in custom metadata and update the Comment field with all comments.

Next time you make changes to Custom Metadata you code will dynamically pickup those changes without retouching the code.

-1

We can populate this by :

IF ( INCLUDES ( parent.multipicklist__c , "Value 1" ), "Value 1; ",null ) &

IF ( INCLUDES ( parent.multipicklist__c , "Value 2" ), "Value 2; ",null ) &

IF ( INCLUDES ( parent.multipicklist__c , "Value 3" ), "Value 3; ",null ) &

IF ( INCLUDES ( parent.multipicklist__c , "Value 4" ), "Value 4; ",null ) &

IF ( INCLUDES ( parent.multipicklist__c , "Value 5" ), "Value 5; ",null )

1
  • Again, this is largely the same as an existing answer.
    – Derek F
    May 1, 2023 at 1:07

You must log in to answer this question.

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