Page 1 of 1
lookup
Posted: Mon Aug 30, 2021 9:56 pm
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.
Re: lookup
Posted: Tue Aug 31, 2021 6:04 am
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?
Re: lookup
Posted: Tue Aug 31, 2021 6:35 am
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
Re: lookup
Posted: Tue Aug 31, 2021 6:43 am
by kev1n
Could just test if it works with the format yyyy-mm-dd?
Re: lookup
Posted: Tue Aug 31, 2021 6:47 am
by GlenMcCabe
Kevin
Have to pick up my daughter. Will try later. Will try with a text input field as well.
Glen
Re: lookup
Posted: Wed Sep 01, 2021 1:13 pm
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.
Re: lookup
Posted: Wed Sep 01, 2021 9:56 pm
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)));
Re: lookup
Posted: Thu Sep 02, 2021 11:07 am
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
Re: lookup
Posted: Thu Sep 02, 2021 11:17 am
by kev1n
What do you see in nuDebug Restults when outputting the DOB in PHP After Browse?