CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 trying to get property of non-object error

Print topic Send  topic

Author Message
CodeChargenewbie

Posts: 114
Posted: 11/05/2007, 7:02 AM

I'm getting a "trying to get property of non-object error" in php custom code. The code in question is global, meaning it's not contained inside a beforeshow script or anything of the sort. In fact, it's in a white space between two sections of gray code. Here's the code:

global $NewForm;
CCSetSession("NumID", 401);
$NewForm->ID->SetValue(CCGetSession("NumID", 0));

The error occurs on last line of the code above. What am I doing wrong?

Thank you.
View profile  Send private message
ckroon

Posts: 869
Posted: 11/05/2007, 8:33 PM

My guess would be that the form object: "ID" doesn't exist.

Check the name of that field in the properties box.

Also check that the form's name is indeed "NewForm"

Of course, I may be way off base...I am like a stopped clock, right at least once a day. :)
_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
ReneS

Posts: 225
Posted: 11/06/2007, 3:13 AM

right twice a day :-D
View profile  Send private message
CodeChargenewbie

Posts: 114
Posted: 11/06/2007, 6:06 AM

It's usually the most obvious oversights, which is why I checked the existence and spelling of the form and field name of the code in question. More over, if the same code is moved into say, beforeshow custom code event, sans global $NewForm because it doesn't need to be declared in the before show event, it works perfectly fine. Yet, outside of custom code events, it gives the error as written above. Strange.
View profile  Send private message
ckroon

Posts: 869
Posted: 11/06/2007, 6:49 AM

re:right twice a day...

Ahh.. but I am a digital clock :-D
_________________
Walter Kempees...you are dearly missed.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.