catalog descp

nameisnani
Mega Sage

Hi Team , 

 

We are having a use case like below 

 

This is the catalog 

nameisnani_0-1718345155552.png

 

nameisnani_1-1718345240245.png

 

 

In the  Short description field auto update has to be show 

 

Auto update the <Short Description> with the following:

"Lost/Stolen" <Device Type> "Reported By" <Requested For>

 

can any one please help me with the confriguration how to achieve this 

 

thanks

8 REPLIES 8

SN_Learn
Kilo Patron
Kilo Patron

Hi @nameisnani ,

 

You can use onChange catalog client script as below:

Variable name in onChange will be 'Device Type' field

 

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }

var reqFor = g_form.getDisplayValue('requested_for');
var newvall = g_form.getDisplayValue('device_type'); //replace with the backend name of device type field

   g_form.setValue('short_description', newvall + " Device Type " + ' '+ " Reported By " + reqFor);
   
}

 

Please Mark My Response as Correct/Helpful based on Impact

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

Zack Hilacan1
Mega Sage

Hello @nameisnani ,

 

Create a catalog client script, you have two options either by using a OnChange Catalog Client Script or OnSubmit.

If you want to directly see it after selecting the device type use On Change catalog client script:
Make sure to change your "Variable Name" to Device Type , since that will be your trigger to auto populate the short description.

ZackHilacan1_1-1718347939979.png

 

If this has been of any help, please mark as solution and give thumbs up.

Regards!

 

nameisnani
Mega Sage

Hi @SN_Learn @Zack Hilacan1 

 

It has to be show like this 

nameisnani_0-1718349175516.png

 

@Zack Hilacan1 @SN_Learn 

 

Please provide me the updated script for this 

Hi @nameisnani ,

 

Try the below and check the output:

 

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }

var reqFor = g_form.getDisplayValue('requested_for');
var newvall = g_form.getDisplayValue('device_type'); //replace with the backend name of device type field

   g_form.setValue('short_description', "Lost/Stolen " +newvall +' '+ "Reported By " + reqFor);
   
}

Please provide the output of the above if it is not working as expected.

 

 

Please Mark My Response as Correct/Helpful based on Impact

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.