This topic is locked
[SOLVED]

 Get Key value from an Edit page

12/31/2019 2:33:53 PM
PHPRunner General questions
B
bartman2003 authorDevClub member

I have an ID column which is the Key value of the table. This is an identity column and should not be inserted and/or editable. The column is not checked via the Fields => Add/Edit boxes. It is only visible on the List page. However, I do need access to the ID value from the "Before record updated" area. Normally I would obtain the value by setting a variable similar to the following:
$requestid=$values["ID"];
This method works for all fields that are selected to be visible on the add/edit pages, however the value is not returned since this key value is not visible. From Javascript I would run something similar to the following:
var url_string = window.location.href;

var url = new URL(url_string);

var requestid = url.searchParams.get("editid1");
This approach would create the variable and capture the value of the ID column since it is part of the key for the table.
How would I go about getting the value from PHP code in the Before record updated section?
Any help would be much appreciated.

N
Nir Frumer 1/1/2020

hi

in place of

$requestid=$values["ID"];
try

$requestid=$_SESSION["YourTABLE_masterkey1"];
hope it helps,

Nir.