The Zurich release has arrived! Interested in new features and functionalities? Click here for more

how to show a field message when particular value selected on variable of catalog ?

1_DipikaD
Kilo Sage

Hi , 

I have below catalog with mentioned select box type variable . I want to show a field message when " add" is selected on that variable . I have tired the below Onchange catalog client script but couldn't get the result .

Please suggest what changes should I make to achieve this ?

 

Thank You

 

function onChange(control, oldValue, newValue, isLoading) {
   if (isLoading || newValue == '') {
      return;
   }
   if (newValue === '1') {
    g_form.showFieldMsg('request_type',"This request requires email approval from the Business mgmt", 'info');
   }
else{g_form.hideFieldMsg('request_type','true');
}


   //Type appropriate comment here, and begin script below
   
}

1_DipikaD_0-1756189366491.png

 

1 ACCEPTED SOLUTION

Please select UI Type as All.

Also, could you post a screenshot of whole Client script. I guess this is the only issue - UI Type is not selected as all.

View solution in original post

12 REPLIES 12

Please select UI Type as All.

Also, could you post a screenshot of whole Client script. I guess this is the only issue - UI Type is not selected as all.

@1_DipikaD  Please check once

Shruti D
Kilo Sage

Hello @1_DipikaD,
Try the below script: 

Applies to: A Catalog Item

Catalog item: Your Catalog item

UI Type: All

Type: onChange

Variable name: Select your variable (i.e., request_type)
Applies on a Catalog Item view  ☑️


Script: 

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

    if (newValue == '1') {
        g_form.showFieldMsg('request_type', "This request requires email approval from the Business mgmt", 'info');
    } else {
        g_form.hideFieldMsg('request_type');
    }
}

 

Please Mark Correct ✔️if this solves your query and also mark Helpful 👍 if you find my response worthy based on the impact.

 

Regards,

Shruti