This topic is locked

Dashboard issue fetching master table ID

12/16/2024 11:53:36 AM
PHPRunner General questions
R
rmac author

Hi All;

I have a dashboard with a transaction table as the master and an inventory list page. The two are tied together by a part number field. The inventory has a SELL grid button intended to copy data from it into the chosen record on the transaction table. I was using $SESSION[transreq_masterRecordData][trans_id] to identify the chosen transaction record, but I find this doesn’t update in the $values array when choosing a new record in the transaction grid. It only seems to update when a refresh is forced on the inventory table; which I can’t do because it would require changing the part number. I have tried to get the current trans_id from the page via the Client Before process, but have so far failed to have anything actually retrieve any data; getting various versions of

  • Uncaught TypeError: Cannot read properties of undefined (reading 'getValue')
  • Uncaught TypeError: Cannot read properties of null (reading 'trans_req.trans_id')

Questions:

  • Is the page data from the transaction table outside of the scope of the inventory table on the dashboard; or have I just not found the right syntax to retrieve it?
  • Would there be a way to update the $values array as part of the button code so I could use the $_SESSION data?

As always, any input is appreciated. Thanks.

img alt

Sergey Kornilov 12/16/2024

I think you can use getMasterRecord() function in this situation:
https://xlinesoft.com/phprunner/docs/button_getmasterrecord.htm

R
rmac author 12/16/2024

Sergey;

Thanks for the quick reply, but that seems to also only pull the id for first record in the list- the same thing I see when I do the $values dump or use the $SESSION variable. I verified that by disabling all id lookup code and it writes that field as 0.

Ray