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
teena jacobteena jacob 

Multi Select LookUp Field in Lightning

Hi,
     How to create multiple records selection from lookup field in salesforce which supports in lightning.
Thanks.
 
NagendraNagendra (Salesforce Developers) 
Hi Teena,

You need to customize the application to cater this requirement. You can create a multi select component that will display all the available options, where the user can select one or more records as per your requirement.

For more information please refer to the below blog post ​​You can also populate the values dynamically (from the server) based on your requirement.


Hope this helps.

Please mark this as solved if it's resolved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.

Thanks,
Nagendra
teena jacobteena jacob
Hi,

               I need that particular field in that object like a dropdown list for multiple selections. Is it possible with lightning?Can u help me
Waqar Hussain SFWaqar Hussain SF
No it does not seems possible on standard layout. You can develop a custom lightning component for multi select. For storing multiple record, you will have to create a junction object instead of lookup field to hold all selected records.
teena jacobteena jacob
Hi Waqar,

           Let me clear my requirement, I have 2 custom objects say 1.Status(with a text field) and 2. Reason(with a text field and a lookup to Status objects text field, but can able to select multiple values) on the creation of a record in Reson object I need to select the lookup values from there.
Is it possible to do with lightning? can u help
Waqar Hussain SFWaqar Hussain SF
You can follow the below article to develop custom component for multi select lookup 
https://www.soliantconsulting.com/blog/2017/03/create-a-custom-salesforce-lightning-multiselect-component
 
Phil WPhil W
A better fit for this will be found on sfdcmonkey (http://sfdcmonkey.com/2018/02/20/multi-select-lookup-salesforce-lightning/).
Tushar sharmaTushar sharma
We don't have native multi select lookup available in Salesforce. So I have created one component in Lightning web component which is generic and can be easily used.

https://newstechnologystuff.com/2019/08/25/lightning-web-components-multi-select-custom-lookup/
vinod Patilvinod Patil
Hi Teena,

It is possible in lighnting in both the frameworks (Aura and LWC)
Working with Aura:
Here you need to create event communication from parent to child and back to parent. Where child will show all the search records in the list format from there user can select the records and will send back to parent component.
In Aura we have restriction to declare global variable so overcome to that we follows event communication approach to cater such kind of requirements.
For more information, please follow the below link:
https://sfdcmonkey.com/2018/02/20/multi-select-lookup-salesforce-lightning/

Working with LWC:
In LWC, we can declare global variable so easy to store the list of selected records and display on the component.
For more information, please follow the below link:
https://newstechnologystuff.com/2019/08/25/lightning-web-components-multi-select-custom-lookup/

Hope this helps.

Please mark this as solved if it's resolved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.