Hi community,

I'm trying to read the value of a custom system setting in creatio from the client-side, but I noticed that even if my setting has the flag "Cached" it results undefined when I try to get the value using this code:

var test = Terrasoft.SysSettings.cachedSettings.UsrSysSettingTest;





while when I use the asynchronous way it works fine.

Code for the asynchronous way:

Terrasoft.SysSettings.querySysSettingsItem("UsrSysSettingTest", function(sysSettingTest) { 

       var test = sysSettingTest; //here is defined

}, this);



Do you know why this is happening?

 

Let me know.

Thanks in advance,

Luca

Like 0

Like

5 comments
Best reply

Hi everyone,

I discovered that the problem with the cached setting was the type of it. To fix the issue I simply had to change the type from Text (500) to Text (250), I tried to do the same in other environments and I had the same result.

Hope it can help.

 

Best regards,

Luca

Hi Luca,

 

I was able to reproduce this behavior using the following steps:

 

1) Create a system setting

2) Don't relogin to the app and execute both commands you've shared in the developer console

 

As a result synchronous call returns undefined, async call returns value.

 

You need to relogin to the app to start using the setting value synchronously (if it won't help try flushing Redis).

 

Best regards,

Oscar

Hi Oscar,

I've actually logged into the app many times, I even closed the browser and flushed Redis, but I still have this issue.

 

Is there anything else I can do?

Thanks.

 

Best regards,

Luca

Luca Tavasanis,

 

Does this issue occur in another browser? In my case cached system setting was fetched properly after relogin and the issue is not in the rights for the setting since you can fetch it asynchronously.

 

Best regards,

Oscar

Oscar Dylan,

Yes, I have this problem also in other browsers.

 

Best regards,

Luca

Hi everyone,

I discovered that the problem with the cached setting was the type of it. To fix the issue I simply had to change the type from Text (500) to Text (250), I tried to do the same in other environments and I had the same result.

Hope it can help.

 

Best regards,

Luca

Show all comments