Welcome to the nuBuilder Forums!

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

select Object in subform

Questions related to using nuBuilder Forte.
BDemeuse
Posts: 92
Joined: Mon Apr 12, 2021 3:09 pm
Has thanked: 1 time
Been thanked: 2 times

select Object in subform

Unread post by BDemeuse »

Hi,

I have created in subform with a select object in it.
Unfortunately the values when loaded from the DB is not displayed.
It is displayed
-) when I change the type of the object into "input" text
-) when records are created from my nuBuilder application

It seems that there is not match between the values in the DB and the values of the select object.

Thanks in advance,

Bri
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: select Object in subform

Unread post by kev1n »

Hi,

Can you show your "SQL or List" for the role select?
BDemeuse
Posts: 92
Joined: Mon Apr 12, 2021 3:09 pm
Has thanked: 1 time
Been thanked: 2 times

Re: select Object in subform

Unread post by BDemeuse »

In the attachment
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: select Object in subform

Unread post by kev1n »

Does an existing row also contain a numeric value ( 0,1,2,3,4) ?
BDemeuse
Posts: 92
Joined: Mon Apr 12, 2021 3:09 pm
Has thanked: 1 time
Been thanked: 2 times

Re: select Object in subform

Unread post by BDemeuse »

No.... It means I need to do a translation but how ?
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: select Object in subform

Unread post by kev1n »

Run SQL Updates on your DB the replace each string with its numeric value. E.g.

Code: Select all

UPDATE your_table SET
rl_role = '0'
WHERE 
rl_role = 'Donateur';
(Replace your_table with your table name)

Then replace all other string values likewise.

Code: Select all

UPDATE your_table SET
rl_role = '1'
WHERE 
rl_role = 'Contact';
etc.
BDemeuse
Posts: 92
Joined: Mon Apr 12, 2021 3:09 pm
Has thanked: 1 time
Been thanked: 2 times

Re: select Object in subform

Unread post by BDemeuse »

Maybe but it means in all my code (SP ...) I need to use these numerical values :-(
No other way to escape ?
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: select Object in subform

Unread post by kev1n »

Well, instead of having a value/text pair in your SQL list

Code: Select all

0|Donateur|1|Contact|2 ....
You could have the same string for the value and text.

Code: Select all

Donateur|Donateur|Contact|Contact|...
In this way the string is stored in the database.
BDemeuse
Posts: 92
Joined: Mon Apr 12, 2021 3:09 pm
Has thanked: 1 time
Been thanked: 2 times

Re: select Object in subform

Unread post by BDemeuse »

oufff This is ok :-)
BDemeuse
Posts: 92
Joined: Mon Apr 12, 2021 3:09 pm
Has thanked: 1 time
Been thanked: 2 times

Re: select Object in subform

Unread post by BDemeuse »

Hi,

Still a question ... something that escapes me :-(
In the subform (grid), I would like to have the fields ordered: role, sous_role, type but it seems it keeps the order of the form object list ... and I do not have any control :-(

Thanks again in advance for your help.

Regards,

Bri
You do not have the required permissions to view the files attached to this post.
Post Reply