searchnetsuitesuitescriptsuitescript2.0clientscript

NetSuite: Emulate Global Search


I'm curious if anyone has come across this question before.

I've been asked a few times if there is a way to emulate the Global Search functionality into another field. I'm guessing Inline HTML, potentially triggered by Client Script, but I don't know where to start.

Anyone worked with the Global Search before?


Solution

  • N/search has a search.global method that returns a search result with columns: name, result, info1, info2 (and id and recordType) It has a promise method that allows use in a client script.

    It's all up to you how you display the results though.

    depending on what you are trying to do another search like operation but more focused is the field.getSelectOptions method. This lets you do a contains, is or startswith search for a matching value for a field. Great if are trying to script a transaction field where the normal select list could be 100k long.