Page 1 of 1

default value for lookup

Posted: Fri Jul 06, 2018 10:33 pm
by marc
Hi,

I can't seem to select a default value for a lookup object upon loading the edit screen.

This is my attempt, to set a value but it does not work. 5afaa13eb523846 is the primary key of the record on the lookup form.

Code: Select all

$('#user_idcode').val('5afaa13eb523846').change();
Note that I can't take the code or description as they are not unique!

Can anyone help with this? Is it possible? Thanks!

Re: default value for lookup

Posted: Fri Jul 06, 2018 10:56 pm
by admin

Re: default value for lookup

Posted: Sat Jul 07, 2018 7:22 am
by marc
admin wrote:marc,

Try this...

https://wiki.nubuilder.cloud/ ... etLookupId


Steven
Is this the primary key of the lookup table?
string1 = Primary Key
What is a primary key of an object?
string2 = Primary Key of Lookup Object to populate

Re: default value for lookup

Posted: Sun Jul 08, 2018 5:49 am
by toms
string2 is the object id (id attribute of the html element) of the lookup object.
I think the description is confusing on the wiki.

Re: default value for lookup

Posted: Sun Jul 08, 2018 6:42 am
by marc
Toms,

Thanks you for clarifying! The information is not clear on the wiki.

Re: default value for lookup

Posted: Mon Jul 09, 2018 4:58 am
by admin
.