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
Tom FarringtonTom Farrington 

how to have users select from a multipick list based on related records

Trying to gather the ID of all related custom object records

Hi all, not an expert, but i've been using salesforce for a couple of years and this one really has me head scratching.  To the point where I now have no where left to go!

I am setting up an API which has been fine, but I need to parse certain record IDs to an object in order to achieve this.  Here is my requirement:

An account has 'Assets'
An account has a custom object called 'Service'.  This object represents a service visit to the site.
I want the user to be able to select which assets are due to be serviced.
So effectivly my ideal would be a multipick list on the custom object 'service' which was pre-populated with the 'assets' from the accounts page.

I don't actually need a related lookup, just a way of having the user select which ones, and then be able to hold the ID's and names of those records in a field on the 'Service' object so that when that object is sent via the API i know which related assets are being serviced.

Due to the fact that it has a many to many relationship (i.e. on service can do all or just one asset, and an asset can appear on just one or multiple services), i created a junction object.  Therefore my user could now select 'New Asset To Service', which puts it in a related list.  But I can't pull from this data, I need to get the record ID data onto the 'Service' object.

I'm happy using any methods, but I'm not much of a coder.  WFR's, process builder, no problems.

Any help would be massivly appreciated as I have no clue which direction to go next.

Many thanks,
NagendraNagendra (Salesforce Developers) 
Hi Tom,

Since you wish to populate a multi-select picklist on the Service record, does this mean that the Asset records are fixed on every Account? If not, then the requirement looks like it would have to be done via a trigger (or perhaps a flow if possible) due to the nature of the relationship (many to many).

I believe workflows are already out of the question, but process builder may be able to pull it off on a multi-select picklist (Try creating a process from the Junction object updating the multi-select picklist on the service record if ever that service doesn't have a specific Asset yet). My only concern here is the process builder limitation when updating a large number of records, as well as the number of Assets that you need to define within the multi-select picklist.

Hope this helps.

Regards,
Nagendra