Openbravo Forum End of Life Notice

Dear Openbravo Forum User,

Because of continued very low usage we decided to stop the forums on 31st of August 2017

In case of questions: webmaster "at"

How define the Selector



Site Admin

Posts: 4

Joined: Wed Jan 09, 2013 7:50 am

Post Sun Sep 25, 2016 8:26 am

How define the Selector

1、Define Table1,fields:ID(vchar);name(vchar);Num(int)
2、Define Table2,Fields:ID(Vchar);Num(int);Other fields; The Num Field reference Num of Table1。in the grid of table2,the Num field use a selector。

How define a selector of Table1, out field is Num。
How define Table2, use Num selector。


Neil Smith

Posts: 202

Joined: Wed Mar 18, 2009 7:26 pm

Post Tue Dec 20, 2016 2:04 pm

Re: How define the Selector


I don't think you can do it like that...

The best way to do it, is to have a foreign key in table2 referencing to table1 (table1_id).
The selector is defined on the table1_id field.

You can either use an out field to get the table1.num field and copy it in the table2.num field or define the table1 record identifier to display the num field, like that it will be displayed when you select the table1 record in the selector.
It depends if you want the information displayed only or if you need to be able to update the field.
Note that copying the data can cause problems, if you come to change the num field in table1, all the table2 records linked to the table1 record will have the 'old' num, not the new updated one.

Hope it helps and that I'm not 3 months late ;)

Best regards


Site Admin

Posts: 1

Joined: Wed Jan 09, 2013 7:50 am

Post Sat Oct 14, 2017 5:08 am

Re: How define the Selector

Have a foreign key in table2 referencing to table1 (table1_id) instead

Return to Developers

Who is online

Users browsing this forum: No registered users and 10 guests

Website Terms

Designed by ST Software for PTF.