How to prevent uncheck of preselect records in multiselect lookup?

Hello team,

 

I have a multiselect detail and I have added code to mark already selected records when the lookup window is opened again. For example if A, B are already added to the multiselect, when user wants to add C,D, E, the records A & B will already be checked.

 

There are multiple validations done before we add a record. Unchecking of already added records will cause complication. 

 

We see preventing uncheck of values as a solution. Is there a way to prevent uncheck of records? 

Like 0

Like

4 comments

Hello Shivani, 

 

Can you please provide the code you are referring to? 

 

Best Regards, 

Igor

 

Ihor Skohariev,

Following is the code I have used, to mark the records already selected as marked. I need to prevent these marked records as unmarked. Basically, we cannot uncheck an already checked record

esq.getEntityCollection(function(result) {
                 	var existsDocumentsCollection = [];
                 	if (result.success) {
                         		result.collection.each(function(item) {
                         		existsDocumentsCollection.push(item.get(”AccountId”));
                          });
                        }
		config.selectedValues = existsDocumentsCollection;

 

Hello, is it correct that currently every time you open and close a lookup window there are no selected records and your code doesn't work? Or it's working but only after validation and you need to make it that the needed values are already selected before that moment?

Dmytro Vovchenko,

 

We have managed to figure this out using custom logic. The rows already selected are marked when we add more records. 

Show all comments