Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Count Assigned To Field

1. Write a Client Script name as getAssignedToCount
2. Glide the Incident Table
3. Use onChange Client Script
4. Use the Field name as "assigned_to" field
5. Glide the Script Include using "GlideAjax".
6. Call the function "getCount" from Script Include
7. Add the parameter for the newValue.
8. Use the getXML for asynchronous response.
9. Get the answer using the callback function
10. Use the logic for the more than how many tickets that error needs to populate
11. Use the addErrorMessage for marking the error message
12. Use the setValue for the "assigned_to" field.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
function onChange(control,oldValue,newValue,isLoading,isTemplate) {
if(isLoading || newValue === '') {
return;
}

var ga = new GlideAjax('countAssignedUtil');
ga.addParam('sysparm','getCount');
ga.addParam('sysparm_assignedto', newValue);
ga.getXML(callback);

function callback(response){
var answer = response.responseXML.documentElement.getAttribute("answer");
if(answer >=5){
g_form.addErrorMessage("Please select another person to work on this Incident, selected user is already having 5 tickets in his/her Queue");
g_form.setValue("assigned_to", "");
}
}
}
Loading