Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Limit Search on a browse form to just one column?

Questions related to using nuBuilder Forte.
Post Reply
Keith-i
Posts: 88
Joined: Wed Jan 18, 2023 3:03 pm
Has thanked: 1 time
Been thanked: 1 time

Limit Search on a browse form to just one column?

Unread post by Keith-i »

Is there a simple way to restrict the search on a browse form to just one column. The default seems to be to search all columns.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Limit Search on a browse form to just one column?

Unread post by kev1n »

Manually via Options Menu:
searchable_columns.png
By Code: nuSetNoSearchColumns()

This function excludes a list of columns from being searched on the current Browse Form.

A new function has been added to nuBuilder: nuSetSearchColumns()
This function includes a list of columns from being searched on the current Browse Form, all other columns are excluded.

E.g. include only the first column:

Code: Select all

nuSetSearchColumns([0]);
You do not have the required permissions to view the files attached to this post.
DRHH
Posts: 3
Joined: Thu Jun 01, 2023 5:36 pm

Re: Limit Search on a browse form to just one column?

Unread post by DRHH »

I am a complete nuBuilder novice with only a few hours experience.

This is exactly what I want to do, but where do I put the call to nuSetSearchColumns?
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Limit Search on a browse form to just one column?

Unread post by kev1n »

Hi,

Place that code in the form's Custom Code.

1) Click on the "Options Menu"
2) Select "Form Properties"
3) Select the "Custom Code" Tab
4) Click on the "Browse" button
5) Write your code in the JavaScript field.


custom_code.png
You do not have the required permissions to view the files attached to this post.
DRHH
Posts: 3
Joined: Thu Jun 01, 2023 5:36 pm

Re: Limit Search on a browse form to just one column?

Unread post by DRHH »

Hello Kevin,
Thanks for your quick response.
I have now got this to work using NuSetNoSearchColumns()

nuSetSearchColumns() does not work for me. Perhaps I am not using the latest version.

Your screenshot above shows a Version Info option in the drop down menu, but I don't see this.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Limit Search on a browse form to just one column?

Unread post by kev1n »

What version are you using? (See button Setup -> Setup tab)
nuSetSearchColumns() was added on February 17th
DRHH
Posts: 3
Joined: Thu Jun 01, 2023 5:36 pm

Re: Limit Search on a browse form to just one column?

Unread post by DRHH »

DB Version V.4.5-2023.04.10.00
Files version V.4.5-2023.05.01.02
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: Limit Search on a browse form to just one column?

Unread post by kev1n »

DRHH wrote: Fri Jun 02, 2023 1:12 pm nuSetSearchColumns() does not work for me. Perhaps I am not using the latest version.

Please show the full code.
Post Reply