![]() |
Sergey Kornilov admin 5/12/2020 |
Step 1. What is the error message? |
R
|
RBrogen author 5/12/2020 |
Step 1. What is the error message?
|
N
|
Nir Frumer 5/12/2020 |
hi, |
![]() |
Sergey Kornilov admin 5/12/2020 |
Enable detailed error messages in web server settings so it shows the actual error message instead of generic error message 500. |
R
|
RBrogen author 5/12/2020 |
hi, may be you should try a space after the while while ($data=$rs->fetchAssoc()){ $result["clientFirstName"]=$data['client_FirstName']; $result["clientLastName"]=$data['client_LastName']; } hope it helps,
|
R
|
RBrogen author 5/12/2020 |
Enable detailed error messages in web server settings so it shows the actual error message instead of generic error message 500.
|
![]() |
Sergey Kornilov admin 5/12/2020 |
Thank you, makes sense. It appears that getMasterRecord() function is not available in the button's Server event but there are workarounds. $data = $pageObject->getMasterRecord(); |
R
|
RBrogen author 5/13/2020 |
Thank you, makes sense. It appears that getMasterRecord() function is not available in the button's Server event but there are workarounds. You can add the following code to BeforeProcess event of the page in question and then use $_SESSION["client_ID"] anywhere you want. $data = $pageObject->getMasterRecord();
|
R
|
RBrogen author 5/13/2020 |
Got it working finally! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=91288&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' /> After getting the SESSION variable properly appended I got Undefined Undefined returned which told me that the original variable was not being set. I had the code to set the session variable in the ORDER form Before Process and it actually needed to be on the details list form. THANKS FOR THE HELP SERGEY! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=91288&image=2&table=forumreplies' class='bbc_emoticon' alt=':)' /> OOOPS Spoke too soon ... I'm still trying to get that to work. I had manually entered the client_ID and it worked but when I try to use the $_SESSION it gives me this error. PHP Fatal error: Uncaught Error: Call to a member function fetchAssoc() on bool in C:\inetpub\wwwroot\StudioSavvy\buttonhandler.php:1908 Stack trace: #0 C:\inetpub\wwwroot\StudioSavvy\buttonhandler.php(364): fieldEventHandler_OrderPayments_Payer_event(Array) #1 {main} thrown in C:\inetpub\wwwroot\StudioSavvy\buttonhandler.php on line 1908 I'm assuming it is because it the rs is not getting a value from the DB::QUERY because the $_SESSION is not pulling the value. $rs = DB::Query("select client_FirstName, client_LastName from dbo.CLIENTS WHERE client_ID = ".$_SESSION['client_ID']); while ($data=$rs->fetchAssoc()){ $result["clientFirstName"]=$data['client_FirstName']; $result["clientLastName"]=$data['client_LastName']; } |
R
|
RBrogen author 5/13/2020 |
I just realized that this works perfect on a form that has been saved and you are editing but when I add a New Order, the client_FK value is not accessible this way because the record isn't saved yet. Any suggestions on accessing the value selected in a field on the form that hasn't been saved would be greatly appreciated. Got it working finally! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=91292&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' /> After getting the SESSION variable properly appended I got Undefined Undefined returned which told me that the original variable was not being set. I had the code to set the session variable in the ORDER form Before Process and it actually needed to be on the details list form. THANKS FOR THE HELP SERGEY! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=91292&image=2&table=forumreplies' class='bbc_emoticon' alt=':)' /> |