This topic is locked

Using button with variables

1/29/2014 2:15:55 PM
PHPRunner General questions
W
wijninga author

Hi,
I am writing a warehouse application, where I added a order button in the detail view. The buttons take one to the create new order screen, where you can enter the amount and some other information. What I am trying to achieve without any luck, is sending the partnumber to the order screen, so the person making the order doesn't have to select the partnumber again.
I have been looking at all the examples, but I just can't get it running. Please be ware that I am NOT creating a new record with a masterkey, but just a new record with only one field (non key) filled.
What I did was add the following code to 'client after':
location.href = "http://localhost:8085/PartsOrder_add.php";;
On the Process record values events, I added the following code:
if(isset($_GET['masterkey1']) && !empty($_GET['masterkey1']))

{

$values['Part_ID'] = $_GET['masterkey1'];

}

However, this doesn't work. So my question: what am I missing here?
Thanks for any reply in advance.

Sergey Kornilov admin 1/29/2014

In general - it might work. You need to troubleshoot your code, make sure that the value of masterkey1 is passed via URL, that your code in ProcessRecordValues event is executed etc.

W
wijninga author 1/29/2014

I know I can pass the masterkey, but as I said, it's not the masterkey I want to pass, just a field value. How should I do that through the URL?

Sergey Kornilov admin 1/29/2014

The typical syntax of passing some value via URL is as follows:

PartsOrder_add.php?somevar=somevalue


Then you can use $_GET["somevar"] anywhere on that page.