jorian_c
Posts: 4
|
| Posted: 07/05/2008, 11:39 PM |
|
I have been using CCS 4 for about a month and I have been impressed, however I have one issue in that I have not found how to pull values off an editable grid when the controls are not part of the initial query. (Nicoles post doesn't help in this situation)
I have the following structure
Table GroupInspectionType
groupInspectionType_ID
inspectionType_Name
Table InspectionType
inspectionType_ID
groupInspectionType_ID
Table AssetInspection
asset_ID
inspectionType_ID
inspection_Score
So I want to add inspections to assets - first I select the group and then I pull all the inspection types from the group into rows on an editable grid. I then add the score listbox to the row and that should be it. I then perform a custom insert and viola! nothing happens.
Parameters are added via the custom insert dialog, and insert type is set to table.
Any tips ?
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 07/06/2008, 8:50 AM |
|
What is the main table for your Egrid?
Could you describe the layout of your EGrid?
Meaning field order and type.
How Many rows in egrid, How many Insert rows?
My assumption:
Table AssetInspection Main
asset_ID either autonumPK or a textbox
inspectionType_ID listbox on InspectionType
inspection_Score an entry textbox
Table InspectionType used as listbox datasource (joined)
inspectionType_ID
groupInspectionType_ID
Table GroupInspectionType
groupInspectionType_ID
inspectionType_Name
The fields to be used in the Custom Insert are all the fields from Main Table, hence I do not see the problem......
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
jorian_c
Posts: 4
|
| Posted: 07/06/2008, 10:10 PM |
|
Firstly thanks for the assistance.
The main table for the egrid is InspectionType, however the insert is on AssetInspection.
As an explanation, each GroupInspectionType contains a number of different InspectionTypes, what I am doing is querying InspectionTypes by groupInspectionType_ID from a URL parameter - this generates a list of InspectionTypes for that group. The purpose is to create a form that brings up entry fields for the complete list of InspectionTypes in that group, the InspectionType_ID is prefilled from the query, asset_ID is prefilled from a URL parameter and the user has only to fill ithe score for each of the inspectionType_ID's and then the custom insert should insert all the records.
For Example
Table GroupInspectionType
_________________________________________
| groupInspectionType_ID | inspectionType_Name |
| 1 | one |
| 2 | two |
-------------------------------------------------------------------------
Table InspectionType
_______________________________________
| inspectionType_ID | groupInspectionType_ID |
| 1 | 1 |
| 2 | 1 |
| 3 | 2 |
| 4 | 2 |
-------------------------------------------------------------------
Now assume the AssetInspection table is empty, and I want to add the following rows using one form.
Table AssetInspection
__________________________________________
| asset_ID | inspectionType_ID | inspection_Score |
| 1 | 1 | 3 |
| 1 | 2 | 4 |
--------------------------------------------------------------------------
So..... the egrid should look this to begin with for egrid.php?asset_ID=1&GroupInspectionType_ID=2
Asset ID inspectionType_ID Score
________ ________ _______
| 1 | | 3 | | |
________ ________ _______
| 1 | | 4 | | |
-------------- -------------- ------------
The the user just fills in the scores and then the custom insert should add the rows to assetInspection.
Hope that is a little clearer.
So is it possible?
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 07/07/2008, 2:24 AM |
|
Aha, that explains a lot.
If the assetInspection table for the given URL parameters already has records, do you want those displayed for update as well?
Do you accept inspection_Score to be empty?
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
jorian_c
Posts: 4
|
| Posted: 07/07/2008, 6:22 AM |
|
The records should not be displayed. Score can be empty.
I am querying the group inspection type to get the complete list of inspection types available for that group - then I want to enter information. If I queried the inspections for a group it would bring the records up - which I dont want, and it doesnt acheive my aim as I am really trying to make a dynamic form where all the inspection types are brought up and the use fills it in.
A little more background.. inspectors go out and they make inspections, say they want to inspect a transformer - they may look at two things - so the group would be a visual inspection and the inspection types may be 1. Tank condition, 2. General condition each of these would have a score associated with it. So using the application they would choose an asset, then select a group inspection type (say visual inspection) this would bring up a form with all the inspection types on it - Tank condition and General condition - they would input their scores and that would be it.
regards,
Jorian
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 07/07/2008, 3:12 PM |
|
One more thing:
"The records should not be displayed"
as answer to
"If the assetInspection table for the given URL parameters already has records, do you want those displayed for update as well?"
leaves me with two questions:
1: what to do with the already entered assetInspection rows? INSERT will fail!
2: What is your PKey definition for AssetInspection?
My current approach would be:
EGrid on assetInspection, always primed by URL ?asset_ID=nn&groupInspectionType_ID=mmm
Before Show we would Insert rows into assetInspection for every combination of asset_ID, InspectionType_ID (derived from groupInsepction) and asset_Score set to empty
The EGrid will be shown with all rows in place and score to be entered (only editable field).
(with or without delete checkbox).
Depending on answer to first question all previously entered rows will be there for update, but Update could be set to false, so could delete btw.
This would be by far the easiest way to accomplish above task.
Another approach would be your EGrid on InspectionType filtered by groupInspectionType.
You would then need to manually set asset_ID label and Score textbox fields.
The Custom Insert would then have to do the INSERT.
Walter
(will experiment)
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
jorian_c
Posts: 4
|
| Posted: 07/10/2008, 3:16 AM |
|
Brilliant. I will do the insert rows suggestion. I am poking around now and I will post the solution when I get it done. Thanks a lot- using the assetInspection table will save me a bit of grief as I was really not looking forward to getting values off the editable grid.
regards,
Jorian
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 07/10/2008, 5:43 AM |
|
@J,
Good choice, let me know if you succeed or need more info/help.
I still wonder though:
If on day one, scores are enterd for asset 1, InspectionType_ID 3 and 4
and you do not want the records in grid for update, how do you handle day two when
for asset 1 InspectionType_ID 3 and 4 come up again?
Or is this a situ that never occurs?
Or is it a transactional type of table, processed and cleared.?
Oh well, you'll tell me.
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
|