how to hide embedded list

chunn
Tera Expert

Hello, can you help me.

I want to hide embedded list on the form about 運用作業日付s embedded list, when run the type of change to monthly .  

I want to client script for implementation it ? 

 

songchunpu_0-1675129197581.png

 

1 ACCEPTED SOLUTION

@chunn ,

 

You can do similar script in UI policy:

 

Condition : Run = monthly

 

Execute if true script:

function onCondition(){
var list = $$('div[tab_caption="運用作業日付"]')[0];//embeded list name
        list.hide();
}

 

Execute if false script:

function onCondition(){
var list = $$('div[tab_caption="運用作業日付"]')[0];//embeded list name
        list.show();
}

 

Please mark the answer correct/helpful based on Impact.
Regards, Shekhar

View solution in original post

12 REPLIES 12

Hemant Goldar
Mega Sage
Mega Sage

Hi @chunn ,

 

Please refer to the below link which will help you to hide the embedded list.

https://www.servicenow.com/community/developer-forum/how-to-hide-embedded-list-of-outages-task-outag...

 

I hope this helps!

 

 

Regards,

Hemant 

**Please mark my answer correct or helpful based on the impact**

Shekhar Navhak1
Kilo Sage
Kilo Sage

Hi @chunn ,

 

Write onChange client script on "Run" field and check isolated script as true.

 

The below the script is you can use to solve your issue:

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }
    var list = $$('div[tab_caption="運用作業日付"]')[0];//embeded list name
    if (newValue == 'Monthly') {
        list.hide();
    }
    //Type appropriate comment here, and begin script below
}
Please mark the answer correct/helpful based on Impact.
Regards, Shekhar

@Shekhar Navhak1 thank you feedback to me. the client script implementation it. but i want to use the UI

Policy how do use it ?  UI Policy the function onCodition...Like abobe code UI Policy is not work...

songchunpu_0-1675211977158.png