Jurjen Roels
|
| Posted: 08/13/2002, 1:33 PM |
|
Hi,
I am totally lost and i don't seem to have a good example.
My knowledge of object oriented programming is not that good.
Can somebody give an example in PHP on something easy describe below.
What should i declare in custom events when i want to do something like this:
I have a record set named products
4 fields: field1 field2 field3 field4 and a IDfield (parameter passed)
I want to have custom event coding (before update) where i do
$avariable = <value of field1>
$avariable2 = <value of field1> * IDfield
<field1> = $avariable2 //set the new value
<field2> = <field1>
Can somebody help me out?
Regards
Jurjen Roels
|
|
|
 |
Ronb
|
| Posted: 08/13/2002, 1:42 PM |
|
global $formname;
$avariable=$formname->field1->Value;
$avariable2=$avariable * $formname->IDfield->Value;
$formname->field1->setvalue($avariable2);
$formname->field2=>setvalue($avariable2);
I have no idea what this would be good for but this is literaly what you wrote above. If you ment to do this only where field1 is equal to field to the thing would look quite differently.
If you're dutch please restate your request in dutch maybe it would become a little clearer what it is you want
|
|
|
 |
Jurjen Roels
|
| Posted: 08/14/2002, 12:09 AM |
|
No it is just to understand that a simple example. Does not have to mean anything...
I am doing something wrong else where and i don't seem to get it...
These examples sometimes help.
And yes i am dutch
Regards
Jurjen
|
|
|
 |
Nicole
|
| Posted: 08/14/2002, 2:45 AM |
|
Jurjen,
use code like below in form Before Show Row event:
global $form_name;
$form_name->field1->SetValue($form_name->field1->Value * CCGetParam("param_name", ""));
$form_name->field2->SetValue($form_name->field1->Value);
|
|
|
 |