Is it possible to display field value by combining two fields?

Thrupthi
Tera Expert

I have two fields on my form

1. Provider

2. Associated Phone Number

I want the third field "Name" to display by combining the value of these two fields

Example:

Provider = Sim

Associated phone number = 12345

Name = Sim - 12345

Can we achieve this?

find_real_file.png

 

17 REPLIES 17

Cody Smith _ Cl
Tera Guru

You could try something like this in an onChange Catalog Client script. 

 

var provider = g_form.getValue('provder').toString();
var phone = g_form.getValue('phone').toString();

var provPhone = provider + phone;

g_form.setValue('name_variable', provPhone)

It looks like your phone variable is using a Reference field. So for that try 

var phone = g_form.getDisplayBox('phone').value;

Hi CodingSmith

 

I tried this by creating the Business rule and it worked for me, but i have one issue facing here. only upon save this is displaying the record

so when i select the field from other form it just pops out and doesn't allow me to select the name value can you please help

 

Business rule:

(function onBefore(current, previous) {

var display = current.u_provider.getDisplayValue() + '\n\n ' + '-' + '\n\n ' + current.u_associated_phone_number.getDisplayValue();
current.name = display;

})(current, previous);

Try adding 

current.update();

 

is the field name of "Name" is name or u_name?

 

var display = current.u_provider.getDisplayValue() + '\n\n ' + '-' + '\n\n ' + current.u_associated_phone_number.getDisplayValue();
current.u_name = display;

 

Also you can use the Calculated field in dictionary and write the script there

find_real_file.png