Hi everyone,

 

Does anyone know if is is possible to set up a field value in business rules by combining 2 strings? For example change the title to something like "Account name - Customer need"? Hope this is achievable without programming as this is really a basic "no code" functionality...

 

 

Thanks!

Like 0

Like

1 comments

A business rule isn't able to do this. 

You could do it with a no code approach by creating a process that starts on the record added or modified that reads the record, then sets the field value by combining the two values. The down side to this approach is that the user won't see this value until they refresh the page.

I realize you're after a no code approach, however, if you want to do this with code, you can add something like this to the methods of the page - this will set the name when the record is saved (assuming the field names are correct):

save: function() {
    var account = this.get("Account");
    var need = this.get("LeadType");
 
    if (account && need) {
        this.set("Name", account.displayValue + " - " + need.displayValue);
    }
 
    this.callParent(arguments);
}

(btw, I don't know why formatted code doesn't format code correctly on these forums, but the && is supposed to be &&)

Ryan

Show all comments

Below is my string which I need to replace with my value:

"The number of concert halls is limited and no more than ${maxAllowedDailyPrograms} daily programs can be active at a time."

 

How I can replace 'maxAllowedDailyPrograms' with value.

Please help

Like 0

Like

2 comments

Hi Riddhi,

Firstly, You need to create virtual attribute

In methods you can set value to system setting value using Terrasoft.SysSettings.querySysSettingsItem()

I have attached code for your reference 

attributes: {

            "SystemSettingValue": {

            dataValueType: this.Terrasoft.DataValueType.INTEGER,

            type: this.Terrasoft.ViewModelColumnType.VIRTUAL_COLUMN,

            "value": 0

            },

        },

In methods,

onEntityInitialized: function() {

                this.callParent(arguments);

                Terrasoft.SysSettings.querySysSettingsItem("maxAllowedDailyPrograms", 

                    function(maxAllowedDailyPrograms) {

                        this.set("SystemSettingValue", maxAllowedDailyPrograms);

                }, this);

            }

Regards,

Akshaya Gajendran

 

Hi Riddhi

You need to save string text as localizable strings in the required edit page schema. While saving, save the string as below,



Name: UsrAlertText

Value: "The number of concert halls is limited and no more than {0} daily programs can be active at a time."

 

As Akshaya mentioned above, you can get the system setting value using the code given by her. The replacement of text can be done using the below mentioned code.

var Text = Ext.String.format(this.get("Resources.Strings.UsrAlertText"),SystemSettingValue);

Here, in Text variable you will get the needed text.

 

Regards

Abinaya

Show all comments