Linking tables (sort of)
Posted: 2015-11-09 19:38
Using version 5.42
Okay, I may be just having a brain pause but after thinking too much about this I am going in circles. (I should be able to figure this out but - oh well, better to ask for a hint)
Situation: Customer wants a repair order system. I will use cars in this example.
Table 1: vehicle_details
This table will allow the user to input their details such as mileage, location of vehicle, driver name etc. Everything about the vehicle but not the issues happening or needing to be fixed as these could be 1 item or 30 items.
Once the record in vehicle_details is filled in and saved I then want the user be able to access table 2 (not a big issue to hide access until a save).
Table 2: problems
In problems they can create as many records as they want listing each problem with a description. Could be 1 problem could be 30.
These records are linked to the record in table 1: vehicle_details. So that when the record in vehicle_details is clicked on it also shows all the records from the problems table which relate to the one record in vehicle_details.
Here is my take on how to do this.
Once the record in vehicle_details is saved get the created id # of the vehicle_details record and then using some code put it in the new record in table 2: problems. As long as the vehicle_details record is on screen each new record created in table 2: problems will be linked to the record in vehicle_details. That way when bringing up the vehicle_details record all the problems listed also show at the same time.
Table 3: repairs_done
This one would link to table 2 but this is easy as the problem is selected which is being worked on after they have selected the vehicle_details which then also brings up all the problems. This is a simple parent/child with a selection criteria based upon the id of the record in vehicle_details.
Now my question: Is there an easy way to do this in AppGini which I am missing or just having a weak moment or is this going to be some custom code type of effort. (No issue if it is but I am thinking there must be a way to link tables together based upon the method above without a lot of hoop jumping. Any ideas anyone?
I do not want the user to have to select the correct vehicle_details record to enter the problem. I want this seamless. It does not matter if they have to save and create a new problems record each time.
Think of how the appgini application uses the PKValue field in membership_userrecords.
Alan
Okay, I may be just having a brain pause but after thinking too much about this I am going in circles. (I should be able to figure this out but - oh well, better to ask for a hint)
Situation: Customer wants a repair order system. I will use cars in this example.
Table 1: vehicle_details
This table will allow the user to input their details such as mileage, location of vehicle, driver name etc. Everything about the vehicle but not the issues happening or needing to be fixed as these could be 1 item or 30 items.
Once the record in vehicle_details is filled in and saved I then want the user be able to access table 2 (not a big issue to hide access until a save).
Table 2: problems
In problems they can create as many records as they want listing each problem with a description. Could be 1 problem could be 30.
These records are linked to the record in table 1: vehicle_details. So that when the record in vehicle_details is clicked on it also shows all the records from the problems table which relate to the one record in vehicle_details.
Here is my take on how to do this.
Once the record in vehicle_details is saved get the created id # of the vehicle_details record and then using some code put it in the new record in table 2: problems. As long as the vehicle_details record is on screen each new record created in table 2: problems will be linked to the record in vehicle_details. That way when bringing up the vehicle_details record all the problems listed also show at the same time.
Table 3: repairs_done
This one would link to table 2 but this is easy as the problem is selected which is being worked on after they have selected the vehicle_details which then also brings up all the problems. This is a simple parent/child with a selection criteria based upon the id of the record in vehicle_details.
Now my question: Is there an easy way to do this in AppGini which I am missing or just having a weak moment or is this going to be some custom code type of effort. (No issue if it is but I am thinking there must be a way to link tables together based upon the method above without a lot of hoop jumping. Any ideas anyone?
I do not want the user to have to select the correct vehicle_details record to enter the problem. I want this seamless. It does not matter if they have to save and create a new problems record each time.
Think of how the appgini application uses the PKValue field in membership_userrecords.
Alan