Client script to change a value

Gemma4
Mega Sage

Hi everyone, 

Can I please get some help with a client script that will change the value of the "short description" to the request_name variable on the portal? I attached a couple screenshots to display what I 'm trying to acheive. (Order guide has the variable request_name that I want to replace the short description on the order guide summary)

I've tried to edit the widget with no luck and was hoping to do this in a client script or script. I'm open to better ideas if anyone has any suggestions. 

 

Thanks so much for any feedback you have!

 

I believe this should be set as the following: 

on change type

sc_cat_item table

field name: short description 

script I tried with no luck

 

function onChange() {
    //Type appropriate comment here, and begin script below
g_form.addInfoMessage("client script testing activated2");
    var request_name = g_form.getValue('request_nameVariable');
 
    if (short_description == 'Test Catalog ITem short descirpion') {
        g_form.setValue('short_description', request_name);
 
    }
}ORDER GUIDE.pngclient script.png

 

 

6 REPLIES 6

Hi @sombir5 

Sorry to report this also did not work. I tried catalog item blank and added the catalog item, both gave the same results.

 

sombir5
Tera Contributor

Hi @Gemma4 

You have to attach the catalog item on the catalog client script.

Fill the details on the form.

Submit it and see the request at backend, short description must be populate with the value of requester name