Hi, i want to build an AwareIM application that sources data from an existing mysql database.
I have defined the business objects in AwareIM, discovered the attributes and defined references between the objects using the foreign key feature during discovery, All looks good, and no errors. I followed the instructions as per the video tutorial.
My first test was to list the contents of Table1 using a query. All good. I then select a listed row to display all its details on a main form. Table1 has a relationship to Table2 - one instance of Table1 may have many related instances in Table2. When the main form displays, the details from Table1 are displayed but no rows from Table2. The data was created so that 4 rows would display.
I noticed that AwareIm set the relationship to Peer, when i would have preferred an Owned By relationship. Is this the oroblem, or do i have to do something else the get the data retrieved and displayed?
Retrieving data from an external table
Re: Retrieving data from an external table
not an issue.ask180 wrote:I noticed that AwareIm set the relationship to Peer, when i would have preferred an Owned By relationship.
that only controls what happens when an owner rec is deleted so Aware can delete child recs to prevent orphans.
Peer is fine. nothing extra happens on a delete.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: Retrieving data from an external table
I don't know about your specific issue with external data... butdo i have to do something else the get the data retrieved and displayed?
let's assume you don't get this to work as desired. What then?
One thing Aware does well is that it easily allows you to show Parent/Child data on the same form when there's a relationship between them.
One thing Aware DOES NOT allow is to show Parent/Child data on the same form UNLESS there is an AWARE relationship (peer, ob) between them...
EVEN THOUGH there is a physical relationship (foreign keys in your case) in the data.
(that just means you can't use the easy "built-in" way to show data ON A SINGLE FORM from related tables)
So, instead of the easy way of just putting the relationship field on the form, and setting the grid properties, you'd have to use a VP Layout with multiple content panels.
From your Table1 Query, when clicking on a row, use a process to save the Table1.PriKey into a temp field in LIRU. Then display the new layout FROMVP. The 1st panel being a FORM for the parent, with a 2nd panel thats a Query... FIND Table2 where Table2.T1_pointer = LIRU.temp_T1
There may be other ways too. You were trying the simple way just to prove you could get to the external data. In my experience, external data opens up a can of worms (that may be too harsh) - but I think thats due to my lack of experience working with it.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: Retrieving data from an external table
Thanks for your thoughts guys.
I still can't understand what the problem is. If I have the external tables defined to AwareIM, and the relationship between them is there (I have shortcuts), then I should be able to display a form showing the data from the two tables (in a one to many relationship). It displays the data from the 'one' table, but not from the 'many' table.
I will persist some more, because I need to put web front-ends on existing databases, and I am so close with AwareiM.
I still can't understand what the problem is. If I have the external tables defined to AwareIM, and the relationship between them is there (I have shortcuts), then I should be able to display a form showing the data from the two tables (in a one to many relationship). It displays the data from the 'one' table, but not from the 'many' table.
I will persist some more, because I need to put web front-ends on existing databases, and I am so close with AwareiM.