Mandatory additional comments in portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2024 01:06 AM
I have created a button to change case status to WIP if end user hit this button.
But i need to make additional comments mandatory before hitting this button. how to achive it.
code is:
HTML
<button type="button" class="btn btn-primary btn-block" ng-click="c.uiAction('change_state')">Move to WIP</button>
Client Controller
c.uiAction = function(action) {
c.data.action = action;
c.server.update().then(function(response) {
c.data.action = undefined;
if (response.data.success) {
alert("State changed successfully!");
$window.location.reload();
} else {
alert("Failed to change state. Please try again.");
}
});
};
server side:
if (input && input.action === 'change_state') {
// Load the current record
var gr = new GlideRecord('sn_customerservice_case');
if (gr.get(input.sys_id)) {
gr.state = 11;
data.success = true;
} else {
data.success = false;
}
}