on change client script is not working for particular catalog item

keval3
Tera Contributor

Hi All,

I have written below client script but it is not working for my catalog item it is apply for all catalog item.

kindly let me know what is issue.

function onChange(control, oldValue, newValue, isLoading, isTemplate) {

    if (isLoading || newValue == '') {

        return;

    }

var catitem = g_form.getValue("u_catalog_item");

alert(catitem);

 

   

   

    //g_form.addInfoMessage("line 9 testing");

 

    if(catitem == '9c9df05597661e500cb57bae2153afe2')

    alert("askhr");

    {

 

    if(g_form.getValue('state') =="7")

    {

g_form.setValue("close_notes", "123455");

g_form.setValue("u_knowledge_article", "no");

g_form.setValue("u_support_type", "desk");

g_form.setValue("u_resolution_code", "Solved (Permanently)");

 

g_form.setValue("u_via_kb_article", "no");

g_form.setValue("u_via_kb_article", "no");

    }

 

    //Type appropriate comment here, and begin script below

 

}

}

 

Thanks & Regards

KP

11 REPLIES 11

Hi Runjay,

I have tried your code but is not not working for my item. I have put current sys_id.

I have checked with other catalog item it is working over there but wrong option have been select.

as per screen snap support type is remote I have put Desk in the script also resolution notes are not populated. I want auto populate  this fields for ASK_HR catalog not for any other.

keval3_0-1735035513967.png

 

Hi @keval3 ,
1. check whether you is your client script set to run on target record.

ChaitanyaILCR_0-1735060596182.png

2. check if all variable mentioned in the client script or correct

3. check the console for errors

 

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful."

Regards,
Chaitanya