maxhugen
Posts: 272
|
| Posted: 10/03/2008, 8:57 PM |
|
I've added a button [Copy] to an Events record page. It's in a panel that hides it, if a new record.
It's purpose is to make a copy of the current record as a new one in the same table `event`.
As a user may have edited the page before clicking Copy, I made the button's operation 'Update'.
The button's OnClick event sets a public flag ( $CopyRequired = 1).
In the AfterUpdate event, if the flag is set, I would like to run an insert query, preferably using CCS functions.
I can see in the event.php page that CCS uses a function InsertRow().
Is there any way that I can get CCS to do an Insert like this somehow?
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com |
 |
 |
maxhugen
Posts: 272
|
| Posted: 10/03/2008, 9:10 PM |
|
I should add that I'm trying to avoid running an insert query manually. The `event` table has an auto increment key, so each field has to be individually specified in the insert, in code. Not good from a maintainability perspective, especially since this table is likely to be altered in the future.
Another option might be to build a manual insert query from the form parameters - CCGetQueryString("Form", "") - but the parameters include many that aren't fields, so this could get messy.
_________________
Max
www.gardenloco.com | www.eipdna.com | www.chrisarminson.com |
 |
 |
|