sosamv
Posts: 50
|
| Posted: 02/04/2009, 4:18 PM |
|
Hi guys! tried looking for "custom insert" on the forum but didnt find what i needed or maybe i didnt undertand the examples LOL.
I need todo a custom insert, to me more specific i need to manually write the insert SQL query and have the same functionality as a normal Codecharge insert (clean the form after insert, bla bla).
Whats the best way to do this?? :S
Custom insert wont work, cuz i need to do some calculations in PHP and save those results, including the fields on the form that i manually entered. all that on a single row af a table.
Thanx
|
 |
 |
jjrjr1
Posts: 942
|
| Posted: 02/04/2009, 4:25 PM |
|
Hi
Try putting your custom calcutaions in the before insert event.
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
sosamv
Posts: 50
|
| Posted: 02/04/2009, 4:58 PM |
|
Let me explain a lil' bit more my problem:
I have a Record Form that it has a couple of fields and a Start Date, based on the start date and other variables I need to generate the "End Date", that calculations are made on PHP, I already made the calculations and i have the "End Date", the question is.......How do i include that dinamically generated date into the insert query? i tried modifying the datasource on the BeforeBuildInsert like this:
$SQL ="INSERT BLA BLA";
$tblingreso->DataSource->SQL= $SQL;
I Need to be able to modify the whole sql string.
:S
|
 |
 |
sosamv
Posts: 50
|
| Posted: 02/04/2009, 5:04 PM |
|
Ouch! my bad! i was making changes to the SQL string on the beforebuild, that was the problem i changed all of my logic to the BeforeExecuteInsert and worked like a charm!!
I need to be more patient
Thanx!
|
 |
 |
jjrjr1
Posts: 942
|
| Posted: 02/04/2009, 5:55 PM |
|
Cool
Glad you got it working.
Have fun as always.
_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com |
 |
 |
|