AJAX Callback Type
From dispage wiki
Enhanced Studio makes the AJAX usage easy and fully exportable across different SugarCRM installations.
AJAX calls can be performed from a Code field (for example using jQuery): from Enhanced Studio 3.1.04 even the AJAX Callback can be programmed from SugarCRM application.
The advantages over a traditional PHP script manually added to the SugarCRM directory are easy to see:
- Authenticated User Access natively checked: no need to add code to prevent unauthorized access to the PHP Callback and to potentially compromise the security of the SugarCRM application by affecting the access permissions policy in the SugarCRM directory.
- Ease of programming: PHP code of AJAX callbacks can be entered from the PHP EditArea tool SugarCRM Studio or Module Builder and debugged with the PHP Online Syntax Checking
- AJAX Callbacks seamlessly exported / imported: AJAX Callbacks made with Enhanced Studio are automatically included in any published or exported packages containing them, and they are seamlessly rebuilt in any SugarCRM installation in which the packages are installed.
Once added an AJAX Callback field, it can be called with the URI
<sugar_base_url>/customAJAXCalls.php?call=<module_name>_<field_name>&<params>
where
- sugar_base_url is the base URL of SugarCRM.
- module_name is the module that the field belongs to.
- field_name is the name of the field, without the ā_cā postfix.
- params is an optional query string containing some parameters that may be passed to the AJAX Callback (from which they are available in the $params array). To send an associative array, the params query string must be generically set this way
params[<key_1>]=<value_1>& ⦠¶ms[<key_n>]=<value_n>
where all keys and values must be URL-encoded.
An example of AJAX callback usage is Autocomplete AJAX country field .