Page 1 of 1

Can't initialize lookup in new register

Posted: Thu Jul 21, 2022 6:43 pm
by Gerry_26
Hello guys, its me again, i want to know how to initializate a lookup when i want to add a new record

Here is the register that I want to initialize:
Captura de pantalla 2022-07-21 112918.png

And here is where i want to initializate the record in a new form:
Captura de pantalla 2022-07-21 113209.png

I did it like this (nuBuilder Pro V.3)
d4750e20-5c8c-4a85-93bf-fb34a447de5d.jpg
This is the code: SELECT REPLACE('#nu_browse_filter#', 'contacto_', '')

How i can do it in this version?

Hope for your answers

Re: Can't initialize lookup in new register

Posted: Fri Jul 22, 2022 9:07 am
by kev1n
Hi,

Where is the Hash Cookie #nu_browse_filter# set?

Re: Can't initialize lookup in new register

Posted: Fri Jul 22, 2022 5:06 pm
by Gerry_26
Thanks for your answer, i'm using this filter
Captura de pantalla 2022-07-22 091744.png
I have a detail master, and in detail I need to initialize a field with filter.

In nuBuilder Pro I have the code value by default, but in this version I can't find where to initialize it
d4750e20-5c8c-4a85-93bf-fb34a447de5d.jpg

Re: Can't initialize lookup in new register

Posted: Fri Jul 22, 2022 5:19 pm
by kev1n
Does #contacto_id# contain the primary key or a string?

Re: Can't initialize lookup in new register

Posted: Fri Jul 22, 2022 5:31 pm
by Gerry_26
Contains the primary key

Re: Can't initialize lookup in new register

Posted: Fri Jul 22, 2022 5:51 pm
by kev1n
In your form's Custom Code, save the Browse filter to a window varriable:
browse.png

When the Edit form is loaded, retrieve it to populate the lookup:
edit.png

Re: Can't initialize lookup in new register

Posted: Fri Jul 22, 2022 6:27 pm
by Gerry_26
It works!, Thanks Kev1n

Like a extra i found an issue

When i save the form, the save button enter in a loop

To solve it, is just add this code
Form_Properties_CC_Edit.png

Re: Can't initialize lookup in new register

Posted: Fri Jul 22, 2022 6:37 pm
by kev1n
Great!

Re: Can't initialize lookup in new register

Posted: Fri Jul 22, 2022 6:40 pm
by kev1n
Maybe just populate the lookup if it's a new record/ the lookup is empty.