php - How to integrate a new file in a module in SugarCRM 7? -


i added new button in detailviews of module, having attribute onclick="genreg(name, type)".

i created function in .js file. function (genreg(name, type)) send variables php file, generatereg.php, using json.

the file in *module_name* folder. in php file try create new object of modules reglement (it's custom module) , add new item database.

the problem doesn't recognize path module reglement.

i included follows:

require_once('modules/reglement/reglement.php'); 

but got following error:

error: failed opening required 'modules/reglement/reglement.php'

paths files:

js: custom/module_name/js/generate.js
php: custom/module_name/generatereg.php

which file shall include in order recognize path?

yes, did error :d, calling directly. change url in js file http://localhost.net/index.php?entrypoint=generatereg , works now. thank lot.

but i've got other error. when call url send post data. in file have post data, function json_decode($_post['data']) return nothing. print_r($_post['data']) -> return valid json json_decode($_post['data']) return nothing

do know if sugar change behaviour of json_decode?


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -