This topic is locked

Error handling with events

12/18/2008 11:37:32 AM
PHPRunner General questions
S
Stettin author

I have a set of code that runs on my Add Page - Before Record added. It looks up some additional information from an LDAP server for a particular user that is being added to our database. It is trying to fill in the full name, e-mail, supervisor, etc based off of their LAN id. I have it set to return false if it cannot find the user, and writes out "Cannot find user" but that code shows up above the add new record box. I'd like to throw the error message out inside the actual add record box, just like the "<<< Record was NOT added >>>" message shows up in red if I try to insert a duplicate LAN id. How would I do this?

T
thesofa 12/18/2008

If you look in visual editor, in the middle of the page is a box with the word

message

in it

If you want error messages to appear, just use this

$message=
S
Stettin author 12/18/2008

If you look in visual editor, in the middle of the page is a box with the word

message

in it

If you want error messages to appear, just use this

$message=


Will that keep the regular PHPRunner errors from displaying? I want to make sure the duplicate record errors show up as well.

J
Jane 12/19/2008

Will that keep the regular PHPRunner errors from displaying?



Yes.
To join to error messages use following code:

$message = "<div class=message><<< Record was NOT added >>></div>";

$message.= "
<div class=message><<< Cannot find user >>></div>";

S
Stettin author 2/6/2009



Yes.
To join to error messages use following code:


I have custom validation code running on my Add page, and these codes show up just fine now. My problem is that the validation code works for Inline Adds on the List page, but the error messages are not displayed. How can I get the error messages to display on the List page when an Inline Add is committed?
For example, I do an IP lookup to see if it is in a table list, and if it isn't I do <<<IP Address not Assigned>>>, but in the List page, when you click the checkmark it just keeps refreshing the page and not saving it until you change the IP to one that is assigned. I need a way to display the $message on the List page, how can I do that?

S
Stettin author 2/6/2009



I have custom validation code running on my Add page, and these codes show up just fine now. My problem is that the validation code works for Inline Adds on the List page, but the error messages are not displayed. How can I get the error messages to display on the List page when an Inline Add is committed?
For example, I do an IP lookup to see if it is in a table list, and if it isn't I do <<<IP Address not Assigned>>>, but in the List page, when you click the checkmark it just keeps refreshing the page and not saving it until you change the IP to one that is assigned. I need a way to display the $message on the List page, how can I do that?


OK I just tried another layout (Paris), and noticed the messages are displaying. The other layout (London) did not show the error messages. Is this a bug?

J
Jane 2/9/2009

It's difficult to tell you what's happening without seeing actual files.
Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.