Hi Everyone,
I'm wondering if there is a way to store any environment variable in SugarCRM for my custom package?
For example, I have a API key in my package, and I don't want to write the string directly in my package.
Thanks a lot!
Sophie
Hi Everyone,
I'm wondering if there is a way to store any environment variable in SugarCRM for my custom package?
For example, I have a API key in my package, and I don't want to write the string directly in my package.
Thanks a lot!
Sophie
- If the instance is hosted in the cloud one way of doing it would be ask Sugar if they can set the variabel in the config.
- We used the connector part for it in the past. So we created a 'dummy' connector where we can set the settings we need
- now we use our own configuration module that stores the settings in the configuration for us. Since its a normal module we can change the settings in the ui and hit 'store in config'
- Last but not least you could use the api /Administration/config/:category to set a config variable in the database that you read in your packag when you want.
One more question please, Jeroen:
is it safe to write directly my KEY directly in the custom package?
I wouldn't rely on it. The package is, with normal use, not retrievable by the user since the package is stored in the upload directory (if i'm correct). Only way to retrieve your package is to download a backup or gain direct access to filesystem of the instance (by which the retrieval of your key, if that is happening, the least of your concerns) On the other hand if you provide the package on a publicly downloadable place I would never set the key in the package itself.
Yes, you're right, on "after save", it will send data to my URL which has an API Key.
Thank you for your suggestion
Yes, you're right, on "after save", it will send data to my URL which has an API Key.
Thank you for your suggestion