Launch Lookup Form from Button?

Questions related to customising nuBuilder Forte with JavaScript or PHP.

Launch Lookup Form from Button?

Unread postby pmjd » Wed Aug 04, 2021 8:21 pm

Hello,

Is there a way to launch a Lookup/Lookup Form from a button instead of the standard field with the magnifying glass? So instead of entering text and searching, the button launches the Lookup's defined form and allows something to be selected from there.

Can't see an obvious way to do it with the Run object as it will nly open the browse forms and not the lookup function, nor a procedure as it's for php. Is there a built in JS function that can do this?

Thanks,
Paul
pmjd
 
Posts: 76
Joined: Fri Mar 12, 2021 7:08 pm
nuBuilder Version: 4.5

Re: Launch Lookup Form from Button?

Unread postby kev1n » Wed Aug 04, 2021 10:59 pm

Use a Lookup Object and set it invisible. Then add a button to your form with an onclick event in the Custom Code having this JS:

Code: Select all
$('#OBJ_IDbutton').click();


Replace OBJ_ID with the Object Id of your Lookup Object.
kev1n
nuBuilder Team
 
Posts: 2010
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Launch Lookup Form from Button?

Unread postby pmjd » Thu Aug 05, 2021 1:05 am

Great, looks perfectly
pmjd
 
Posts: 76
Joined: Fri Mar 12, 2021 7:08 pm
nuBuilder Version: 4.5


Return to Custom Code

Who is online

Users browsing this forum: No registered users and 8 guests