Skip to content

Commit 094f849

Browse files
naveensnowrohi-v
authored andcommitted
Update ui_page_client.js
making the values mandatory
1 parent d98ce67 commit 094f849

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Client-Side Components/UI Pages/Resolve Incident UI Page/ui_page_client.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
// Below code will be used in client script of UI page as mentioned in README.md file
22

33
function ResolveIncidentOnsubmit(sysId) { //This function is called in UI page HTML section When user clicks the Submit button
4-
var rejectionReason = document.getElementById('resolution_reason').value;
5-
var resolutionCode = document.getElementById('resolution_code').value;
4+
var rejectionReason = document.getElementById('resolution_reason').value.trim();
5+
var resolutionCode = document.getElementById('resolution_code').value.trim();
6+
if (!rejectionReason || rejectionReason === ' ') {
7+
alert('Resolution Notes is a mandatory field.');
8+
return false;
9+
}
10+
if (resolutionCode == 'None') {
11+
alert('Resolution Code is a mandatory field.');
12+
return false;
13+
}
614
var ga = new GlideAjax('ResolutionProcessor');
715
ga.addParam('sysparm_name', 'updateRecord');
816
ga.addParam('sysparm_record_id', sysId);

0 commit comments

Comments
 (0)