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.
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.
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.
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.
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
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