|
D
|
DMORT 11/25/2026 |
|
It looks like it could be a timing issue with your custom button’s Client Before JavaScript. When you trigger the save click, JavaScript immediately moves on to check proxy["NotifyError"] before the server has finished saving the record and running AfterAdd/AfterEdit—so the proxy value isn't set yet and it defaults to "X". |
|
|
G
|
GaryW author 11/25/2026 |
|
Did a few tests and it could be related to the sequence of the events. I also ready the section in the manual that says setProxyValue should be used in the BeforeProcess event. Before Display I also saw in the manual in the After Edit this note: Note: If you need to display a message on the page or pass a variable value to JavaScript, you need to add the following to the end of your event code: Any ideas what this does? |
|
|
D
|
DMORT 11/25/2026 |
|
$pageObject->stopPRG = true; disables PHPRunner's normal Post/Redirect/Get (PRG) behavior following a successful save, which should allow messages and proxy values generated in AfterEdit to be passed back to the client. I don't believe that makes the Save operation synchronous, though. Your additional testing seems to support the timing issue, since all four events you identified populate the proxy value before your custom button is clicked. Have you tried eliminating the custom Save button and checking for the proxy value in the Edit page's JavaScript OnLoad event instead? if (proxy["NotifyError"]) { Keep your existing AfterEdit code, including stopPRG = true, and use the standard Save button. For testing purposes, you could temporarily set the proxy value to a hardcoded error message to eliminate the email notification logic as a variable. I would first test this by opening the Edit page in full-screen mode and then repeat the test using the master/child drilldown popup. If it works in full-screen mode but not in popup mode, it may indicate that the remaining issue is how PHPRunner handles closing the popup after a successful save. Might help isolate the issue. |
|