if incident task state is one of closed complete, closed incomplete, closed skipped then form should be in read only and ative= false

yogesh jori
Tera Contributor

 if incident task state is one of closed complete, closed incomplete, closed skipped then form should be in read only and ative= false

1 ACCEPTED SOLUTION

Hajar BENJAHHAR
Mega Sage

Hello, 

Your goal is to set actuve to false and at the same time to disable all fields in the form. 

Propostion to achieve this is to create a display business rule and a client script. 

    1- Display business rule : 

find_real_file.png

find_real_file.png

find_real_file.png

 

    2- client script : 

find_real_file.png

function onLoad() {
// put the desired states : 
    if (g_scratchpad.active=="false" && (g_scratchpad.state =="6" || g_scratchpad.state == "7" || g_scratchpad.state == "8")) {
        //Set all fields read only
        for (var x = 0; x < g_form.elements.length; x++) {

            g_form.setReadOnly(g_form.elements[x].fieldName, true);
        }
    }

}

Regards, 

Hajar

View solution in original post

5 REPLIES 5

Hajar BENJAHHAR
Mega Sage

Hello, 

Your goal is to set actuve to false and at the same time to disable all fields in the form. 

Propostion to achieve this is to create a display business rule and a client script. 

    1- Display business rule : 

find_real_file.png

find_real_file.png

find_real_file.png

 

    2- client script : 

find_real_file.png

function onLoad() {
// put the desired states : 
    if (g_scratchpad.active=="false" && (g_scratchpad.state =="6" || g_scratchpad.state == "7" || g_scratchpad.state == "8")) {
        //Set all fields read only
        for (var x = 0; x < g_form.elements.length; x++) {

            g_form.setReadOnly(g_form.elements[x].fieldName, true);
        }
    }

}

Regards, 

Hajar