1

Is there a way to add built-in search to a select type field for suitlet?

I have a dropdown (select) field with a few thousand options. I was wondering if there is a way to add search functionality, similar to the one available for some record fields (attached image).

enter image description here

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Adrian
  • 347
  • 1
  • 6
  • 18
  • Your select field is sourcing from a Record Type (standard or custom record type) or are you adding the select values using "addSelectOption" ? – B. Assem Nov 17 '21 at 20:15
  • I am using addSelectOptions. – Adrian Nov 19 '21 at 10:51
  • 1
    Then you can add another text field to allow the users to enter the search text and use client script "fieldChanged" event (or use pure jQuery) to run a search to get your filtered data and then you can reset the available options on your Select field by using the functions "removeSelectOption" and "addSelectOption" – B. Assem Nov 21 '21 at 16:19

2 Answers2

1

I think you must use the client script to handle select2 jQuery library, but it's hard to apply to suitlet form if you want it.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
0

Since I didn't find a NetSuite way of doing this. I went with 'select2' library, and used jQuery to handle the events. Maybe this will help someone...

Adrian
  • 347
  • 1
  • 6
  • 18