Skip to content

Commit 19e08c4

Browse files
author
SWETHA R
authored
Updated UIaction.js
1 parent e7b798d commit 19e08c4

File tree

1 file changed

+23
-5
lines changed
  • Client-Side Components/UI Pages/Edit Last WorkNotes

1 file changed

+23
-5
lines changed
Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
1-
//Enable client set to true
2-
//Enter Onclick value as function name openEditLastCommentModal()
3-
//Enter form button as true
1+
/**
2+
* Opens a modal to edit the last Work Notes or Additional Comments.
3+
*
4+
* @description
5+
* This function is triggered by a form button (set to true),
6+
* with client-side execution enabled. It opens a GlideModal
7+
* using the UI macro "edit_worknotes_comments_inc" and sets
8+
* the current incident sys_id as a preference for use within the modal.
9+
*
10+
* Usage:
11+
* - Set Client = true
12+
* - Set OnClick = openEditLastCommentModal()
13+
* - Set Form Button = true
14+
*/
415
function openEditLastCommentModal() {
16+
// Create and configure the GlideModal
517
var dialog = new GlideModal("edit_worknotes_comments_inc");
6-
dialog.setTitle('Edit Last WorkNotes/Additional Comments');
7-
dialog.setPreference('incid', g_form.getUniqueValue());
18+
dialog.setTitle("Edit Last WorkNotes/Additional Comments");
19+
20+
// Pass the current record's sys_id to the modal
21+
dialog.setPreference("incid", g_form.getUniqueValue());
22+
23+
// Optional: Adjust modal width
824
dialog.setWidth(550);
25+
26+
// Render the modal
927
dialog.render();
1028
}

0 commit comments

Comments
 (0)