Page 1 of 1

How to add extra 'description' boxes on lookup

Posted: Tue Mar 14, 2023 3:04 pm
by Keith-i
When creating a lookup you get the option to add another field of related data in an adjacent description box by selecting the field you want to be displayed. Is there any way to add extra boxes to show further data? Ideally I need to add 2 further boxes so that the user can, at a glance, see that they have selected the right record. I'm presuming I use the 'Display' type but I'm lost as to how to implement it to show the extra fields.

Re: How to add extra 'description' boxes on lookup

Posted: Tue Mar 14, 2023 3:55 pm
by kev1n

Re: How to add extra 'description' boxes on lookup

Posted: Tue Mar 14, 2023 4:49 pm
by Keith-i
Thanks. I've created 2 new read-only 'input' boxes on the form and named them disp_houseno and disp_unitname and placed the below code into the AfterBrowse of the lookup but am not getting any response. Can you spot my error?

Code: Select all

$lu = nuLookupRecord();

nuSetFormValue('disp_unitname', $lu->UnitName);
nuSetFormValue('disp_houseno', $lu->HouseNo);

Re: How to add extra 'description' boxes on lookup

Posted: Tue Mar 14, 2023 4:54 pm
by kev1n
Add

Code: Select all

nuDebug(nuLookupRecord());
to see what fields are output in nuDebug Results.

Re: How to add extra 'description' boxes on lookup

Posted: Tue Mar 14, 2023 5:00 pm
by Keith-i
I don't get as far as getting any debug message. As soon as I select a record in the lookup table I get the spinning wheel/egg-timer and nothing happens.

The console gives this

Code: Select all

Uncaught TypeError: $(...)[0] is undefined
    resetIframes http://192.168.1.114/rcsdb/index.php line 2 > injectedScript:35
    onclick http://192.168.1.114/rcsdb/index.php:3
index.php line 2 > injectedScript:35:15
Uncaught SyntaxError: expected expression, got '>'
    nuPopulateLookup http://192.168.1.114/rcsdb/core/nuform.js?ts=20230314134425:4567
    successCallback http://192.168.1.114/rcsdb/core/nuajax.js?ts=20230314134425:599
    success http://192.168.1.114/rcsdb/core/nuajax.js?ts=20230314134425:15
    jQuery 4

Re: How to add extra 'description' boxes on lookup

Posted: Tue Mar 14, 2023 5:02 pm
by kev1n
Did you really place the code in After Browse? (and not the yellow LUJS field)

Re: How to add extra 'description' boxes on lookup

Posted: Tue Mar 14, 2023 5:10 pm
by Keith-i
Another schoolboy error! You are spot on, I didn't realise that was a button to press to access the After Browse code box. I had indeed put it in the LUJS. All working now, so thanks again.

Re: How to add extra 'description' boxes on lookup

Posted: Thu Mar 16, 2023 8:37 am
by kev1n
You're welcome! I'm glad to hear that everything is working now. If you have any more questions or need further assistance, feel free to ask.