You need to sign in to do that
Don't have an account?
Jose María Nicolás Arfelis
How to convert a Related List to a Comma Separated List
Hi all,
I am looking for possibilities to catch values in a specific Master-Detail field within a junction object.
For example, I have the object Event. There is another object Account --> Record Type "Professors". Event and Professor have a many to many relationship.
For the many to many relationship I created a junction object Relationship Professor - Event. This junction object hast two Master-Detail fields. One pointing to Event and one pointing to a Professor.
Now our client would like to have the values on the Professor Master-Detail fields as comma separated values in a field on the Event object, so they can have a tabular view when entering to the Events tab seeing the Professors participating on that event. For this I created the field "Professor (s)" on the object Event.
For example, if we have:
EVENT PROFESSOR
Event X Michael Fox
Event Y Tanya Mitchells
The field Professors should show: Michael Fox, Tanya Mitchells.
After looking for possible solutions how to implement this, I found this link:
http://blog.jeffdouglas.com/2012/04/10/convert-a-related-list-to-a-comma-separated-list/
when I implemented it, it didn't work totally.
When you delete a professor in the list of professors (Account --> Record Type "Professor"). The related record in the junction object gets deleted. But the field Professor(s) on the object Event doesn't update automatically with the trigger mentioned in the link above. You have first to go to one of the records in the junction object Relationship Professor - Event --> press button Modify on that record and then save. Only after doing this, the field "Professor(s)" on Event gets updated.
Have someone dealt with such a requirement?. Is there something missing in the proposed code in the link mentioned above?.
I am looking for possibilities to catch values in a specific Master-Detail field within a junction object.
For example, I have the object Event. There is another object Account --> Record Type "Professors". Event and Professor have a many to many relationship.
For the many to many relationship I created a junction object Relationship Professor - Event. This junction object hast two Master-Detail fields. One pointing to Event and one pointing to a Professor.
Now our client would like to have the values on the Professor Master-Detail fields as comma separated values in a field on the Event object, so they can have a tabular view when entering to the Events tab seeing the Professors participating on that event. For this I created the field "Professor (s)" on the object Event.
For example, if we have:
EVENT PROFESSOR
Event X Michael Fox
Event Y Tanya Mitchells
The field Professors should show: Michael Fox, Tanya Mitchells.
After looking for possible solutions how to implement this, I found this link:
http://blog.jeffdouglas.com/2012/04/10/convert-a-related-list-to-a-comma-separated-list/
when I implemented it, it didn't work totally.
When you delete a professor in the list of professors (Account --> Record Type "Professor"). The related record in the junction object gets deleted. But the field Professor(s) on the object Event doesn't update automatically with the trigger mentioned in the link above. You have first to go to one of the records in the junction object Relationship Professor - Event --> press button Modify on that record and then save. Only after doing this, the field "Professor(s)" on Event gets updated.
Have someone dealt with such a requirement?. Is there something missing in the proposed code in the link mentioned above?.
There you go,here's one of the most excellent blog from Jeff Douglas answering your question.For complete information please check here http://blog.jeffdouglas.com/2012/04/10/convert-a-related-list-to-a-comma-separated-list/
Kindly mark this as solved if it helps.
Best Regards,
Nagendra.P