![]() |
Admin 3/6/2020 |
If you are adding button to the master page then getMasterRecord() won't work but getCurrentRecord() will. |
A
|
aeaton2017 author 3/7/2020 |
If you are adding button to the master page then getMasterRecord() won't work but getCurrentRecord() will. There must be some other code there produces this issue. Use this article to see find the exact output from buttonhandler.php request: https://xlinesoft.com/phprunner/docs/troubleshooting_custom_buttons.htm It will point you in the right direction.
|
N
|
Nir Frumer 3/7/2020 |
I am looking for a custom button from the MasterTable Info to go to another page for an employee. Here is what I got so far Server: $data = $pageObject->getMasterRecord(); $result["EmployeeID"]=$data["id"]; also tried $record = $button->getCurrentRecord(); $result["EmployeeID"]=$record["id"]; Client After: location.href='documents_list.php?mastertable=AdminEmployee&masterkey1='+result["EmployeeID"]; It gives an error with no error message. So I really don't know what the issue could be. Thoughts?
|
![]() |
Admin 3/7/2020 |
It depends on where you adding this button in Page Designer. If you adding it to something that is the part of the Details table, use getMasterRecord(). If you adding it to something that is the part of the Master table, use getCurrentRecord(). In either case, you need to figure out what exactly is wrong following steps in the article I mentioned. |
A
|
aeaton2017 author 3/9/2020 |
It depends on where you adding this button in Page Designer. If you adding it to something that is the part of the Details table, use getMasterRecord(). If you adding it to something that is the part of the Master table, use getCurrentRecord(). In either case, you need to figure out what exactly is wrong following steps in the article I mentioned. From what I see, there is some other code in your Server event that causes this issue.
|
![]() |
Admin 3/12/2020 |
According to what I see the value of $result["EmployeeID"] passed from Server is null or empty. This means you need to go to the server event and make sure that the correct value is being assigned to $result["EmployeeID"]. |
![]() |
Admin 3/12/2020 |
I have run some tests and it appears that that server part of buttons added to "masterlist" page is not executed at all. This is a bug in PHPRunner and we will fix it. $value = "<a href='documents_list.php?mastertable=AdminEmployee&masterkey1=".$data["id"]."'>Employees</a>"; |
A
|
aeaton2017 author 3/13/2020 |
I have run some tests and it appears that that server part of buttons added to "masterlist" page is not executed at all. This is a bug in PHPRunner and we will fix it. So the best workaround, for now, is to set one of master table field 'View as' type to Custom. And here is the code that you can use: $value = "<a href='documents_list.php?mastertable=AdminEmployee&masterkey1=".$data["id"]."'>Employees</a>";
|