Please provide scenarios for assignment group using on change client script

NaveenKumarSN
Tera Expert

Hi,

 

Any one please share scenarios most commonly asked in interviews on change client scripts.

 

3 ACCEPTED SOLUTIONS

SK Chand Basha
Giga Sage

Hi @NaveenKumarSN  majorly asked this scenario on incident form I want to show a pop with Ok or Cancel if click on Ok incident will be created if click on cancel not able to create incident what is the approach to acheive this. 

 

 Mark this Helpful !!. If this Helps you to understand. This will help both the community and me.

View solution in original post

 

1]Onchange of state if state is canceled make all fields read only.

Approach 1] Not Recommended

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }
    if (g_user.hasRole("itil") && g_form.getValue("state") == 😎 {
        var fields = g_form.getEditableFields();
        alert(fields);
        for (var x = 0; x < fields.length; x++) {
            g_form.setReadOnly(fields[x], true);
        }
    }
    //Type appropriate comment here, and begin script below

}

Approach 2] Make all field read only using UI Policy.

 

Q.2]Make worknotes field  mandatory on incident form when assignment group changes.

 

Mark this Helpful !!. If this Helps you to understand. This will help both the community and me.

Thank You.

 

 

View solution in original post

Hello @NaveenKumarSN ,

PFB Below PDF which contain lot of use cases related to client script.

Mark this Helpful !!. If this Helps you to understand. This will help both the community and me.

Thank You.

 

View solution in original post

4 REPLIES 4

SK Chand Basha
Giga Sage

Hi @NaveenKumarSN  majorly asked this scenario on incident form I want to show a pop with Ok or Cancel if click on Ok incident will be created if click on cancel not able to create incident what is the approach to acheive this. 

 

 Mark this Helpful !!. If this Helps you to understand. This will help both the community and me.

 

1]Onchange of state if state is canceled make all fields read only.

Approach 1] Not Recommended

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }
    if (g_user.hasRole("itil") && g_form.getValue("state") == 😎 {
        var fields = g_form.getEditableFields();
        alert(fields);
        for (var x = 0; x < fields.length; x++) {
            g_form.setReadOnly(fields[x], true);
        }
    }
    //Type appropriate comment here, and begin script below

}

Approach 2] Make all field read only using UI Policy.

 

Q.2]Make worknotes field  mandatory on incident form when assignment group changes.

 

Mark this Helpful !!. If this Helps you to understand. This will help both the community and me.

Thank You.

 

 

Hello @NaveenKumarSN ,

PFB Below PDF which contain lot of use cases related to client script.

Mark this Helpful !!. If this Helps you to understand. This will help both the community and me.

Thank You.

 

NaveenKumarSN
Tera Expert

Hi Abhijeet,

 

Gone through pdf file and thanks for sharing.

 

if possible please share on assignment group scenarios for the same.