Question

Fetch System settings value using ESQ Server side

Hi,

Is there a way to fetch System setting values using ESQ Server side.

I need to validate based on system setting value.

 

Please help.

 

Like 1

Like

8 comments

You can get a system setting using the following C# :

var mySetting = Terrasoft.Core.Configuration.SysSettings.GetValue(UserConnection, "MyCustomSetting").ToString();

Ryan

Ryan Farley,

Can i use it in server side?

Sriraksha KS,

Yes. That is C# for executing it server side (for example, in a script task or a configuration service)

Ryan Farley,

How can i fetch in client side? i need to take the value from system settings in ContactPageV2. how can i do that. Please help!!

Sriraksha KS,

_initLmsDocumentations: function() {

                    var sysSettingsNameArray = ["UseLMSDocumentation"];

                    Terrasoft.SysSettings.querySysSettings(sysSettingsNameArray, function(values) {

                        this.set("UseLMSDocumentation", values.UseLMSDocumentation);

                        if (values.UseLMSDocumentation === false) {

                            this.set("IsAcademyBannerVisible", false);

                        }

                        Terrasoft.AcademyUtilities.getUrl({

                            scope: this,

                            contextHelpCode: this.name,

                            callback: this._onGetAcademyUrlCallback

                        });

                    }, this);

Are we still not able to set SystemSetting values for current user?

 

I have a case where I'd like to run an API method which return Token values, which I'd like to store in System Settings

Julius,

You can do it using a script task with the following code:

var userConnection = Get<UserConnection>("UserConnection");
Terrasoft.Core.Configuration.SysSettings.SetValue(userConnection, "IsDebug", false);
return true;

As a result the system setting with "IsDebug" code will get a "false" value after the execution of the code. So you can use this approach if needed.

Julius,

I have an article here that outlines how to read and set system settings from both server-side and client-side code, as well as per-user setting values. 

https://customerfx.com/article/retrieving-and-setting-system-settings-i…

Ryan

Show all comments