DrivenTooFar
Posts: 10
|
| Posted: 03/02/2007, 6:44 AM |
|
I have a page created with an editable grid. The page allows for 4 empty rows that can be filled out. The problem I am having is that it inserts nulls into the database if nothing was entered. What I am trying to do is not have anything inserted at all if there was nothing entered.
Basically if I fill out only 2 out of the 4 rows then I want only 2 rows put into the database, not 2 rows with info and 2 rows of nulls. Is there a quick and easy way to do this in CS or is it something I will have to write. Thank you for your help.
|
 |
 |
matheus
Posts: 386
|
| Posted: 03/02/2007, 6:50 AM |
|
Have other field (hidden) in same line?
Editable Grid calculate empty line if didn't have any field filled.
So, if had some hidden (with session value, for example), fill this hidden value in OnValidate from field.
_________________
Matheus Trevizan
Dynamix Software Ltda.
Blumenau SC Brasil
www.dynamix.com.br |
 |
 |
DrivenTooFar
Posts: 10
|
| Posted: 03/02/2007, 12:51 PM |
|
So basically I will add hidden fields for each field that will hold the original data and if there is something there it will insert? Other wise it will not do anything and not insert nulls? Just making sure I understand correctly.
|
 |
 |
Edd
Posts: 547
|
| Posted: 03/05/2007, 5:32 PM |
|
DrivenTooFar,
I am guessing but one of the problems most people have with editable grids is that they put default values into a line, example a key field from the primary table. If you do this CCS thinks you have a something in this line and wants to insert it.
To get around remove the default values, then create a custom insert (type table) for the editable grid. Then go through each value and set the source of the postings, i.e. control for fields on the form and for your key field from the primary table you might select that this value comes from the URL.
Cheers Ed
_________________
Accepting and instigating change are life's challenges.
http://www.syntech.com.au |
 |
 |
|