Get $data from a combobox field

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
tchristophe
Posts: 10
Joined: 2019-10-22 14:13

Get $data from a combobox field

Post by tchristophe » 2024-10-10 09:06

Hi community,
Il have a table "hotels" with field "client" (int) in read only mode still documented by combobox informations from another table.
I've tried to get the value with
$client = $data['client']; in the hotels hook file but it return nothing.
I've also tried to get the filterer_client value in the URL of the view page by the GET method but it does not work.
hotels_view.php?SelectedID=1&filterer_client=3&SortField=&SortDirection=&FirstRecord=1&Embedded=0&DisplayRecords=all&SearchString=&record-updated-ok
<?php
// For help on using hooks, please refer to https://bigprof.com/appgini/help/advanced-topics/hooks/

// récupération de l'id client
$filterer_client = $_GET['filterer_client']; // Int

function hotels_init(&$options, $memberInfo, &$args) {
/* Inserted by Inline-Detail-View Plugin on 2024-08-31 04:20:50 */
// DO NOT DELETE THIS LINE
require_once("plugins/inline-dv/InlineDV.php");
$options->SeparateDV = 0;
/* End of Inline-Detail-View Plugin code */

return TRUE;
}

Do you have an idea to get the value of this field in the hook page ?
Thank you for your suggest and ideas !
Regards
Christophe

ppfoong
Veteran Member
Posts: 52
Joined: 2021-07-13 16:46

Re: Get $data from a combobox field

Post by ppfoong » 2024-10-10 17:06

Look at the comment part right on top of the function.

Is the field name appears in the comment part? If it is not there, then $data["xxxxx"] is not available.

You can use sqlValue() function to select for the field value directly from the database.

Post Reply