Attached is a picture of the relation window. Let me know if you think I’m doing anything wrong. The primary key of Panels is id_panels plus id_projects.
is the relation valid when you call loadRecords?
try application.output("count "+panels_to_panel_members.getMaxRecordIndex()) to see in your output window how many records are in there before calling loadRecords
application.output("count "+panels_to_panel_members.getMaxRecordIndex())
forms.panel_members.controller.loadRecords(panels_to_panel_members)
application.showFormInDialog(forms.panel_members,5,130, 510, 500, " Panel Members ")
I get an error message: “Cannot convert null to an object”
If I go to Tools/Relations the panels_to_panel_members is listed as part of the panels table but it is not listed in the editor under relations for either the panels_one_member form on which I am clicking or the panel_members form that I want to open.
gstein:
I get an error message: “Cannot convert null to an object”
Thats what I thougth you are passing null to loadRecords…
You are using the relation from within the wrong form or it is not defined at all (is named different) ,did you move the code? or type it yourselfs?
When I created the one or both of the panel forms, I may have copied a different form and then changed the referencing table and other properties of the controls in the properties window.
Thats not what I mean, in the editor treeview on a form node is a relations subnode, can you move the relation “code” (with move code button) into your script?
Moving code makes sure the syntax is valid and you are accessing it the right way (handy incase you are not sure)
In the editor treeview I have two panel forms, both based on the panel_members table. They both have the same list of relations – but the relation I want is not listed there at all. I can only see the relation I want by going to the Relations window and looking at the Panel (not Panel Members) table.
When I popup the Panel Members form, I want to limit the records to only the related Panel that is currently selected on the Panels_One_Member form.
gstein:
– but the relation I want is not listed there at all. I can only see the relation I want by going to the Relations window and looking at the Panel (not Panel Members) table.
Exactly, this means that relation is not accessible from the that form, the form table must be the same as the left side table from the relation.