lookup

Questions related to using nuBuilder Forte.

lookup

Unread postby GlenMcCabe » Tue Aug 31, 2021 5:26 am

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.
Attachments
lookup.png
lookup.png (1.89 MiB) Viewed 187 times
GlenMcCabe
 
Posts: 105
Joined: Sun Sep 29, 2019 8:10 pm

Re: lookup

Unread postby kev1n » Tue Aug 31, 2021 1:34 pm

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?
kev1n
nuBuilder Team
 
Posts: 2008
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: lookup

Unread postby GlenMcCabe » Tue Aug 31, 2021 2:05 pm

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
GlenMcCabe
 
Posts: 105
Joined: Sun Sep 29, 2019 8:10 pm

Re: lookup

Unread postby kev1n » Tue Aug 31, 2021 2:13 pm

Could just test if it works with the format yyyy-mm-dd?
kev1n
nuBuilder Team
 
Posts: 2008
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: lookup

Unread postby GlenMcCabe » Tue Aug 31, 2021 2:17 pm

Kevin

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

Glen
GlenMcCabe
 
Posts: 105
Joined: Sun Sep 29, 2019 8:10 pm

Re: lookup

Unread postby GlenMcCabe » Wed Sep 01, 2021 8:43 pm

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.
GlenMcCabe
 
Posts: 105
Joined: Sun Sep 29, 2019 8:10 pm

Re: lookup

Unread postby kev1n » Thu Sep 02, 2021 5:26 am

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

Code: Select all
nuSetFormValue('DOB', date('d/m/Y', strtotime($lu->DOB)));
kev1n
nuBuilder Team
 
Posts: 2008
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: lookup

Unread postby GlenMcCabe » Thu Sep 02, 2021 6:37 pm

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
GlenMcCabe
 
Posts: 105
Joined: Sun Sep 29, 2019 8:10 pm

Re: lookup

Unread postby kev1n » Thu Sep 02, 2021 6:47 pm

What do you see in nuDebug Restults when outputting the DOB in PHP After Browse?
Code: Select all
nuDebug(nuLookupRecord()->DOB);
kev1n
nuBuilder Team
 
Posts: 2008
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5


Return to General

Who is online

Users browsing this forum: No registered users and 27 guests

cron