Distinct or unique values on reference field / lookup

Nik Amy
Tera Contributor

Hey all

On a form i have created a reference field which points to a custom table and this table has NO UNIQUE key.

So upon clicking the lookup icon, it should display only unique or distinct values like below it should show only 1200 and 1300.

 

      VenIDName
1200ABC
1300XYZ
1200JKL

I have made use of reference qualifier and wrote a code like

vendorIdList = arrayUtil.unique(vendorIdList);

This is working, but since the table has some thousands of records, its taking very long time to display the unique values.

Any other method to achieve this quickly.

TIA

17 REPLIES 17

bernyalvarado
Mega Sage

Hi Nikh,



You can create your field to be a choice type of field instead of a reference type.



Thanks,


Berny


bernyalvarado
Mega Sage

By having choice type of field you can then click on the related link advanced view at the Dictionary Entry of the field. Over there you can specify whether the choice list should contain none or not, and most important you can specify the choice table which is going to retrieve the unique list of VenIDs.



Thanks,


Berny


bernyalvarado
Mega Sage

Keep in mind to be in the advanced view of the dictionary entry of your field, otherwise you will not see the Choice Table option.



Thanks,


Berny


Hey bernyalvarado



but as I said, the values are huge. It has some 10000 records and around 800 unique values.



Thanks


Nikh