Make Assignment Mandatory

Arjun Kumar Le1
Tera Contributor

I have writtten on submite client script

 

function onSubmit() {
    //Type appropriate comment here, and begin script below


    var currentState = g_form.getValue('state');
    var assignmentGroup = g_form.getValue('assignment_group');
    var assignedTo = g_form.getValue('assigned_to');

    if (!assignmentGroup) {
        alert('Please fill the Assignment Group.');
        return false;
    }

    if (currentState === '6' || currentState === '3') { // Resolved or On Hold
        if (!assignedTo) {
            alert('Please fill the Assigned To.');
            return false;
        }
    }

    return true;
}
1 REPLY 1

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

You are sharing some piece of code, though... what's your question?

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn