You need to sign in to do that
Don't have an account?

hi to check duplicated in the List and show a pop-up in salesforce
list<string> Productdetails = new list<string>();
empdetails.add('sony');
empdetails.add('samsung');
empdetails.add('Voltas');
empdetails.add('bluestar');
list<string> Itemdetails = new list<string>();
empdetails.add('LG');
empdetails.add('samsung');
empdetails.add('Butterfly');
need to check it if the duplicate is ther, need to show a pop up as already exists,with bootstrap popup model
thanks
deepika
empdetails.add('sony');
empdetails.add('samsung');
empdetails.add('Voltas');
empdetails.add('bluestar');
list<string> Itemdetails = new list<string>();
empdetails.add('LG');
empdetails.add('samsung');
empdetails.add('Butterfly');
need to check it if the duplicate is ther, need to show a pop up as already exists,with bootstrap popup model
thanks
deepika
In case if you want to stop people from entering a value already present in list then I think you can make use of a set so that the values are not duplicated.
I hope this helps in case if it does can you please choose this as the best answer so that it can be used by others in the future.
Regards,
Anutej
thanks
Deepika
If that is the case instead of appending th values directly by hardcoding, one possibility I could think of is to have a input box and have an add button to append to the list and on clicking on add you can have an alert to state your message in case if there are any duplicates present in the list.
I hope this helps.
Regards,
Anutej