frdmgrp
Posts: 16
|
| Posted: 05/25/2010, 11:25 AM |
|
Was trying to create a custom where clause for an update transaction in an editiable grid.
Unlike the select, you are not able to put something in the beforebuildupdate point, since the where clause is being established after that point. And if you try to use the beforeexecuteupdate, the where clause has already been integrated into the sql statement, and is therefore not easily modded.
I got around this by customizing the CC code directly (in the Update method), but am not comfortable with keeping it this way. Is there a way to do what I want (add to the where clause of an update statement on an editable grid) without having to modify the generated code?
An additional question along the same lines, it seems every row in the grid gets updated, even if nothing was changed? Is that true, and is there a way to tell during the update which rows were changed and which were not?
This is CC3.2/ASP.
Thanks!
|
 |
 |
CodeChargeMVP
Posts: 473
|
| Posted: 06/04/2010, 7:48 AM |
|
Hello,
It´s quite hard getting what you desire in every single case without modifying the generated code, modifying the generated code in the way you like is the best way to learn everything
about codecharge and indeed and the language than you´re programming, PHP etc..
For example a beginner programmer did some big mistakes than i´ve resolve, copying buttons from one page to other, no changing names, the code was horrible unreadable,
and furthermore the update was giving a mistake,but fourtunately I resolve Thinking and
programming.
Quote frdmgrp:
Was trying to create a custom where clause for an update transaction in an editiable grid.
Unlike the select, you are not able to put something in the beforebuildupdate point, since the where clause is being established after that point. And if you try to use the beforeexecuteupdate, the where clause has already been integrated into the sql statement, and is therefore not easily modded.
I got around this by customizing the CC code directly (in the Update method), but am not comfortable with keeping it this way. Is there a way to do what I want (add to the where clause of an update statement on an editable grid) without having to modify the generated code?
An additional question along the same lines, it seems every row in the grid gets updated, even if nothing was changed? Is that true, and is there a way to tell during the update which rows were changed and which were not?
This is CC3.2/ASP.
Thanks!
_________________
Best Regards
Entrepeneur | NT Consultant
|
 |
 |
frdmgrp
Posts: 16
|
| Posted: 06/04/2010, 11:51 AM |
|
Thanks for the response. I guess you are correct. It just seemed a natural place to provide a code insertion point, once i got past customizing the gerenerated code, things went well.
|
 |
 |
CodeChargeMVP
Posts: 473
|
| Posted: 06/05/2010, 10:23 AM |
|
That´s nice to heard,
to understand the code generated by codecharge, just divide et imperia,
For example, when you create a search record grid, codecharge generates
three clases with three datasources for every one of three elements than you have
on the visual page,furthermore you´ll notice than if you don´t settled up the datasource
in the visual mode this is not generated in the php code, so this is very important to manage it.
Quote frdmgrp:
Thanks for the response. I guess you are correct. It just seemed a natural place to provide a code insertion point, once i got past customizing the gerenerated code, things went well.
_________________
Best Regards
Entrepeneur | NT Consultant
|
 |
 |
|