function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SKollcakuSKollcaku 

How to concatenate values of field B once the field A is selected?

Hi,

I have two fields, let’s say A and B, of type Lookup Relationships and they are of cardinality 1-to-n (A could have more than one values of field B).
The business request is to have a new field which lists all the values of of B once A is selected. Both objects are Accounts and they are related to opportunities.
The aim is to have a report which visualizes the results…
 
Thanks in advance,
Skender
 
Best Answer chosen by SKollcaku
Richard Jimenez 9Richard Jimenez 9
Hi Skender,

This is one of those problems where the customer needs to know the effort vs need. If i'm understanding this requirement correctly, you will need to use triggers (AI,AU,AD) on the child records to roll-up the concatenation of the fields across the child and update the parent record. There are roll-up helpers in AppExchange which you could use, or you can write your own.

Thanks,
Richard

All Answers

Richard Jimenez 9Richard Jimenez 9
Hi Skender,

Have you looked into creating a custom report type that includes the objects via the relationships, and then grouping the results by this field. The values won't be concatenated, but you should be able to visualise the related values in a summary or matrix report (also look at joined reports if you need to report across report types).

Hope that helps,
Richard Jimenez
SKollcakuSKollcaku
Thank you very much Richard for your immediate response!

I tried building the Report and it is true; all the information is included there, but the specific need from the customer is not to have at each line the same field A title…
That’s why I was looking for some code to try putting the results in a completely new calculated field.
Any idea?
 

Thanks again,
Skender
 
SKollcakuSKollcaku
If ths can help: let's suppose that A is an account and B is an opportunity or a custom field. The relation is 1 A <> n B...
Richard Jimenez 9Richard Jimenez 9
Hi Skender,

This is one of those problems where the customer needs to know the effort vs need. If i'm understanding this requirement correctly, you will need to use triggers (AI,AU,AD) on the child records to roll-up the concatenation of the fields across the child and update the parent record. There are roll-up helpers in AppExchange which you could use, or you can write your own.

Thanks,
Richard
This was selected as the best answer