[SOLVED] Â Print from View page |
8/6/2020 4:50:07 PM |
PHPRunner General questions | |
W
WilliamB authorDevClub member
I have a Bill of Lading app that after a record is created and line items are added (details table), it goes to the view page. From here the user can click on one of 3 custom buttons that open 3 different print pages (Bill of Lading, Commercial Invoice, CUSMA) based on the open record. $record = $button->getCurrentRecord();
var id = result["recid"];
if($_GET["editid1"])
|
|
![]() |
Sergey Kornilov admin 8/7/2020 |
Printer-friendly pages are designed to be open after their respective list pages. The List page populates some session variables that are being used on the printer page lately. If you open printer friendly page directly those variables will be empty and this is why you do not see details tables data, the printer page won't know that we are in the master-details mode. |
W
|
WilliamB authorDevClub member 8/10/2020 |
Printer-friendly pages are designed to be open after their respective list pages. The List page populates some session variables that are being used on the printer page lately. If you open printer friendly page directly those variables will be empty and this is why you do not see details tables data, the printer page won't know that we are in the master-details mode. So you need to investigate what session variables need to be populated by going the "normal" route first and then set those variables in your Server event before redirecting to the printer page.
echo "<pre>".print_r($_SESSION, true)."</pre>";
|
![]() |
Sergey Kornilov admin 8/10/2020 |
Make sure you are visiting details page via master table page first. There should be variables related to the master-details relationship. [order details_preview_masterkey1] => 10285 |
W
|
WilliamB authorDevClub member 8/11/2020 |
Make sure you are visiting details page via master table page first. There should be variables related to the master-details relationship. [order details_preview_masterkey1] => 10285
if($_GET["editid1"]){
|
W
|
WilliamB authorDevClub member 8/12/2020 |
I got this to work. Not sure if it is the correct way buy it seems to always gives the correct result. var id = result["recid"];
|