Welcome to the nuBuilder Forums!

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

lookup

Questions related to using nuBuilder Forte.
Post Reply
GlenMcCabe
Posts: 114
Joined: Sun Sep 29, 2019 12:40 pm

lookup

Unread post by GlenMcCabe »

Folks

I am having a problem using a lookup and after browse to populate a form. I am hoping to populate several objects but am starting with only one - DOB

The lookup works but the DOB is not being populated. The browse window does not clear. I have to x out of it. The lookup details are correct. Nothing is appearing in nudebug.
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: lookup

Unread post by kev1n »

Does the DOB column exist in the lookup window and is the db column exactly written like that (all upper case)?
And what is the format of the date?
GlenMcCabe
Posts: 114
Joined: Sun Sep 29, 2019 12:40 pm

Re: lookup

Unread post by GlenMcCabe »

Kevin

DOB exists in the lookup. Format dd/mm/yyyy It is called DOB in column name and is type date. Format on form is nuDate dd/mm/yyyy.

Glen
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: lookup

Unread post by kev1n »

Could just test if it works with the format yyyy-mm-dd?
GlenMcCabe
Posts: 114
Joined: Sun Sep 29, 2019 12:40 pm

Re: lookup

Unread post by GlenMcCabe »

Kevin

Have to pick up my daughter. Will try later. Will try with a text input field as well.

Glen
GlenMcCabe
Posts: 114
Joined: Sun Sep 29, 2019 12:40 pm

Re: lookup

Unread post by GlenMcCabe »

Kevin
I tried and could not get it to work. I have tried several options using nulookup and / or lookup and display objects.
I am wondering if the structure I am trying to use is the problem.
I have a top level table of clients who are referred for assistance. A client can have several referrals. Currently any referral can have underlying tables and each referral can have several actions, several onward referrals, several files attached etc.
The change I am trying to cope with concerns dementia referrals which has been added as a new service. A dementia referral will include carer details. The carer in many instances may also be referred for problems of their own. Carers are added to the client table.
I need, on any referral for a dementia client to refer back up to the client table and display the main details of the carer. I.e. I need to display details from the parent table on the child form.
On a referral for a carer (isolation, financial etc) I need to display the referral details of the dementia referral they care for. i.e. I need to display details from one referral on another referral.
My structure is
Browse edit form for client. Choose from browse list and details of the client are shown on an edit form which also contains an iframe. Also allows addition of new client.
The iframe contains a browse edit form for referrals. The browse shows all referrals for the client chosen and allows addition of new referral.
I have added a row in the referral table for the clientid of the carer, I I have added a lookup to the referral form for carer and this works happily displaying a virtual row which includes Title Forename Middlename Surname. My problems occur when I try to access other rows from the client table.
I have tried adding them directly to the referral form but get problems with object ids when I use nulookup afterbrowse. I get problems with display objects not having client rows available in sql.
I have tried a subform on the referral form for client but have lookup problems.
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: lookup

Unread post by kev1n »

When setting the value, convert the date format to dd/mm/yyyy:

Code: Select all

nuSetFormValue('DOB', date('d/m/Y', strtotime($lu->DOB)));
GlenMcCabe
Posts: 114
Joined: Sun Sep 29, 2019 12:40 pm

Re: lookup

Unread post by GlenMcCabe »

Kevin

I tried that with no luck. I then tried, in after browse,

$lu = nuLookupRecord();
nuDebug(nuLookupRecord());

When I add nuLookupRecord() the lookup seems to freeze but I can x out of it. The debugger is empty but F12 produced this

Failed to load resource: the server responded with a status of 404 ()
VM120:1 Uncaught ReferenceError: nuLookupRecord is not defined
at eval (eval at nuPopulateLookup (nuform.js?ts=20210902085315:2930), <anonymous>:1:1)
at nuPopulateLookup (nuform.js?ts=20210902085315:2930)
at successCallback (nuajax.js?ts=20210902085315:588)
at Object.success (nuajax.js?ts=20210902085315:17)
at c (jquery.js?ts=20210902085315:2)
at Object.fireWith [as resolveWith] (jquery.js?ts=20210902085315:2)
at l (jquery.js?ts=20210902085315:2)
at XMLHttpRequest.<anonymous> (jquery.js?ts=20210902085315:2)

Glen
kev1n
nuBuilder Team
Posts: 4297
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: lookup

Unread post by kev1n »

What do you see in nuDebug Restults when outputting the DOB in PHP After Browse?

Code: Select all

nuDebug(nuLookupRecord()->DOB);
Post Reply