Fetch only 1st 5 characters from a variable in catalog item

Shalika
Tera Expert

I have 2 variables 'Application short name' and 'VM Name'. I have the requirment to populate the VM Name variable with the 1st 5 characters of Application short name.

How to do this

1 ACCEPTED SOLUTION

Gontla Mythily
Tera Expert

Hi Shalika,

 

You can use OnChangeb catalog client script and JS method(SLICE) to achieve this requirement.

 

var field1 = g_form.getValue("application_short_name");
var b = a.slice(0,5);
g_form.setValue("vm_name",b);

View solution in original post

1 REPLY 1

Gontla Mythily
Tera Expert

Hi Shalika,

 

You can use OnChangeb catalog client script and JS method(SLICE) to achieve this requirement.

 

var field1 = g_form.getValue("application_short_name");
var b = a.slice(0,5);
g_form.setValue("vm_name",b);