Two actions are available for managing popup. You can insert a php script before the query is made to load the data. In addition, it is possible to insert another php script before the data is shown, so you can edit this data or the result when the popup is closed. In the first case, the are two methods available:

SDK::setPopupQuery($type, $module, $param, $src, $hidden_rel_fields = '');

$type : “field” or “related” to indicate a standard field or popup opened from a related list
$module: the module in which the popup opens
$param : the name of the field that opens the popup (must be uitype 10) in the case type = "field", otherwise the name of the connected module
$src : the path of php file
$hidden_rel_fields : associative array of fields to pass in the popup request like array($urlvalue => $jscode)

To remove the customization:

SDK::unsetPopupQuery($type, $module, $param, $src);

Same parameters as before

The following variables are available within the php script:
$query : the query that takes the values to show
$sdk_show_all_button : if true it shows the button to cancel the SDK restrictions and show all records

In the second case there are the following methods:

SDK::setPopupReturnFunction($module, $fieldname, $src);

$module : the module containing the field that opens the popup
$fieldname : the name of the field that opens the popup (only uitype 10)
$src : the php file

To remove the customization:

SDK::unsetPopupReturnFunction($module, $fieldname = NULL, $src = NULL);

For now the only fields supported are those with uitype 10.




SDK::setPopupQuery('field', 'Contacts', 'account_name', 'modules/SDK/examples/PopupQuery1.php');
SDK::setPopupQuery('related', 'Contacts', 'Products', 'modules/SDK/examples/contacts/PopupRelQuery.php');
SDK::setPopupReturnFunction('Contacts', 'vendor_id', 'modules/SDK/examples/ReturnVendorToContact.php');
Back to top