- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2022 11:20 AM
I want to update current records in cmdb_ci table but when user clicks on the UI action it should open the comment box and when user clicks on ok it should update data along with that comment in short description.
can anyone help me with this requirement, that would be really helpful.
thanks!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2022 04:31 AM - edited 11-01-2022 04:33 AM
Please try the below script:
function UpdateData() {
var answer = confirm('Do you want to update this record');
if (answer) {
gsftSubmit(null, g_form.getFormElement(), 'function_name');
}
}
if (typeof window == 'undefined')
updateValues();
function updateValues() {
current.setValue("state", 7);
current.update();
var childInc = new GlideRecord("incident");
childInc.addQuery("parent_incident", current.getUniqueValue());
childInc.query();
while (childInc.next()) {
childInc.state = "7";
childInc.comments = "Your comments here";
childInc.update();
}
action.setRedirectURL(current);
}
I hope this help.
Please mark this helpful if this helps and Accept the solution if this solves your issue.
Regards,
Kamlesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2022 08:55 PM
You can replicate the same from the following link, Just modify the table in UI Action
http://servicenowguru.com/wp-content/uploads/2010/09/dialogWindow-UIPage.jpg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2022 11:20 PM
Hi @Priti18
Try the below link, same has been advised by Sai Kumar B as well, it's just that in Sai's link main content page is missing.
https://servicenowguru.com/system-ui/glidedialogwindow-advanced-popups-ui-pages/
I Hope this helps.
Please mark this helpful if this helps and Accept the solution if this solves your issue.
Regards,
Kamlesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2022 02:52 AM
please check my below code, as am not able to figure out why the changes are showing on the record
ui action on cmdb_ci and client is ticked
function A() {
var answer = confirm('Do you want to update data');
if (answer) {
gsftSubmit(null, g_form.getFormElement(), 'function_name');
}
if (typeof window == 'undefined')
updateData();
function updateData() {
alert('code is running till here');
current.setValue("state", 7); // this is not updating
current.setValue("", gs.getMessage("record updated by the user"));
current.update();
action.setRedirectURL(current);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-01-2022 02:59 AM
Issue is in your third last line, filed name is missing in setValue().
Regards,
Kamlesh