# Valuelist related values problem

**URL:** <https://forum.servoy.com/t/valuelist-related-values-problem/2513>\
**Category:** Classic Servoy\
**Created:** [August 20, 2004, 1:29pm UTC](https://forum.servoy.com/t/valuelist-related-values-problem/2513 "2004-08-20T13:29:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![gstein](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@gstein](https://forum.servoy.com/u/gstein)\
**Post date:** [August 20, 2004, 1:29pm UTC](https://forum.servoy.com/t/valuelist-related-values-problem/2513/1 "2004-08-20T13:29:54Z")

</div>

I have a form based on a table called addresses\_mailing. Two of the fields of that table are id\_organizations and id\_departments.

The id\_organizations field is a type-ahead control which is linked to a valuelist of my organizations table. It works fine.

What I want is for the id\_department field to only display the departments of that organization. I have a table called departments which has a one to many relationship with the organization table. I have a relationship called departments\_belong\_to\_organizations which works fine if I create a form on the Organization table with a portal to the Departments table.

But, if I create a related valuelist for the id\_department in the form based on the addresses\_mailing table, and I set the valuelist as a “No N-M Relation”, using the departments\_belong\_to\_organizations relation and pick the appropriate fields to show in the list and return to the dataprovider, I don’t get any values in the id\_departments control even when I select an organization in the id\_organizations control that has many related departments.

Can you tell me what I am doing wrong?

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [August 20, 2004, 2:13pm UTC](https://forum.servoy.com/t/valuelist-related-values-problem/2513/2 "2004-08-20T14:13:06Z")

</div>

It seems that you do it the right way.

do you have a sample for me?

---

<div class="post-metadata">

**Author:** ![gstein](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@gstein](https://forum.servoy.com/u/gstein)\
**Post date:** [August 20, 2004, 2:51pm UTC](https://forum.servoy.com/t/valuelist-related-values-problem/2513/3 "2004-08-20T14:51:35Z")

</div>

I am trying to send you a sample as an attachment.

I exported the solution with two forms and related data. That created a peer.servoy file on 1,102 kb. When I try to add it as an attachment to this message it works for awhile and then gives me an error: Upload Error: Could not upload Attachment to ./files/peer.servoy.

Can I email or ftp it to you?

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [August 20, 2004, 3:01pm UTC](https://forum.servoy.com/t/valuelist-related-values-problem/2513/4 "2004-08-20T15:01:00Z")

</div>

it should work fine now. uploading is fixed

---

<div class="post-metadata">

**Author:** ![gstein](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@gstein](https://forum.servoy.com/u/gstein)\
**Post date:** [August 20, 2004, 3:35pm UTC](https://forum.servoy.com/t/valuelist-related-values-problem/2513/5 "2004-08-20T15:35:49Z")

</div>

Here is the sample. Thanks for your help.

You should see two forms. One is the addresses\_mailing form as I described to you. The other is a people form which has the addresses\_mailing table as a protal. That is where I really want it to work, but I thought it would be best/easier to try and get it working just in its own addresses\_mailing form first.

Thanks again for your help!

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [August 20, 2004, 10:14pm UTC](https://forum.servoy.com/t/valuelist-related-values-problem/2513/6 "2004-08-20T22:14:01Z")

</div>

you can’t just use any relation for that valuelist and then hope it can be resolved.

That valuelist uses a relation that wants a organisations value at the left.  
But the form is build on adress\_mailins, so that relation can never be resolved.

If you want to use a valuelist with a related. You have to make a relation that uses the adress\_mailings.organistations\_id as left value. Because that value is available. See solution i attached.

---

<div class="post-metadata">

**Author:** ![gstein](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@gstein](https://forum.servoy.com/u/gstein)\
**Post date:** [August 21, 2004, 7:37am UTC](https://forum.servoy.com/t/valuelist-related-values-problem/2513/7 "2004-08-21T07:37:25Z")

</div>

Johan,

I am having trouble importing the peer2.servoy file you sent me. When I try to import it I get an error with the foillowing details:

com.servoy.j2db.persistence.RepositoryException: com.servoy.j2db.persistence.RepositoryException: Reserved words used as table or column names: columns: type type type type sort sort type sort type type type type type type password type type type type;  
Reserved words used as table or column names: columns: type type type type sort sort type sort type type type type type type password type type type type;

I am running Servoy Version R2 2.1 rc4-build 307  
Java 1.4.2-040b05  
Windows 2000 Professional

What should I do???

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [August 21, 2004, 7:55am UTC](https://forum.servoy.com/t/valuelist-related-values-problem/2513/8 "2004-08-21T07:55:22Z")

</div>

you see that it is complaining about reserved words (you didn’t build the tables with servoy)  
So check the box allow reserved words in the import dialog

---

<div class="post-metadata">

**Author:** ![gstein](https://avatars.discourse-cdn.com/v4/letter/g/c89c15/32.png) [@gstein](https://forum.servoy.com/u/gstein)\
**Post date:** [August 21, 2004, 8:13am UTC](https://forum.servoy.com/t/valuelist-related-values-problem/2513/9 "2004-08-21T08:13:35Z")

</div>

OK. That did it.

Thanks very much for your help!!!
