How to set the toggle button to not include items by default when the form loads on "choose options" tab in SC order Guide Widget

Arsh2
Tera Guru

Hi Community,

 

How to set the toggle button to not include items by default when the form loads on "choose options" tab in SC order Guide Widget?

 Currently it's includes all the items by default by turning on the toggle button to right. 

Could you please advise how to achieve this? I want users to select the options what they require by turning on the toggle button.

find_real_file.png

Thanks,

Arsh

1 ACCEPTED SOLUTION

Arsh2
Tera Guru

Hi Stephen,

 

Thanks for your reply. I found the solution for my requirement.

 

All you have to do is to set the value to "False" in server script of the widget.

 

item.included = true;

 

This will enable the items to "NOT INCLUDE" by default.

 

Cheers,

Arsh

 

View solution in original post

13 REPLIES 13

Hi Sindhu and Tim,

I did play around with your requirement and Yes you can achieve it by editing the code. In the Service portal "SC order Guide" widget - 

  • comment out Line 70

  • From line 75 insert the below code:
if (item.sys_id=="catalog_item_sys_id") { //input the sysid of catalog item which you want to disable to toogle for
item.included = false;
gs.log("Hiding the toogle field for" + item.sys_id);
}else {
item.included = true;
}

The above code make the toggle button disable for the catalog item you input in the if clause. i did try on my instance which looks like below

 

I recommend to create duplicate of the OOB widget and try doing it. Hope it helps

 

Cheers,

Arsh 

Dasbeav
Tera Contributor

I realize this may be a longshot, but you don't have happen to still have those screenshots, do you?

Hey, I have the same need, could you please upload the screenshots? It would be a great favor

Aayushi tandon
Tera Contributor

Hey Arsh, i tried same thing what you have shared, but it is not working for me. please let me know where i am missing. it would be a great favor