This topic is locked
[SOLVED]

 How to change a field value in Before Display (Edit Pag

2/24/2011 4:40:39 PM
PHPRunner General questions
Francisco author

Hi,
I need to read a value from a query, and then change the value that will be presented on the Edit Page.

I have been trying many ways with no luck. Does anyone knows how to do this?
In the Before Display page I get a value from a custom query. It comes ok. Let's say is $data["OrderNo"]

Then I have a field called DefaultOrderNo, so what I added is:

$xt->assign("DefaultOrderNo_value",$data["OrderNo"]);


With no luck, even replacing de $data["OrderNo"] with a hardcoded number.
Any ideas? Other approach?
Thanks!
PD: PHPRunner 5.2

P
procheck 2/24/2011

If you're trying to do this in Before Display, I don't think that $data is available there.

Francisco author 2/28/2011



If you're trying to do this in Before Display, I don't think that $data is available there.


Thanks prochecksports.

Totally agree, it is not available. In fact that "$data" is my own recordset generated by a custom query.
But the thing is, that even without using "$data" and hardcoding a value in

$xt->assign("DefaultOrderNo_value",33);


it is not working. Any other ideas?
Thanks!

Admin 2/28/2011

Check ProcessValues event:

http://xlinesoft.com/phprunner/docs/process_record_values.htm
You can change any field value there.

Francisco author 3/1/2011



Check ProcessValues event:

http://xlinesoft.com/phprunner/docs/process_record_values.htm
You can change any field value there.


Great! It is what I was looking for.
Thanks for your time.