How to refresh Relates List upon submission of current record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 03:01 AM - edited 10-25-2023 03:07 AM
Hello
Upon submitting the current form, the Related List for Impacted Services should automatically refresh based on the updated Configuration Item selected in the Incident form.
Please refer to the BR:
When: Before Insert/Update
Condition: Configuration item changes
Advance:
Condition - new CIUtils().canShowRefreshServicesUIAction(current.sys_class_name)
Script:
(function executeRule(current, previous /*null when async*/ ) {
new TaskUtils().triggerRefreshImpactedServices(current); // Calling script include TaskUtils
action.setRedirectURL(current);
})(current, previous);
And please refer to OnLoad client script: (Tried both client script)
function onLoad() {
if (g_form.hasMessages()) {
var messages = g_form.getMessages();
for (var i = 0; i < messages.length; i++) {
if (messages[i].getText() == "Hello this is incident") {
g_form.$('task_cmdb_ci_service').ajaxOperation();
break;
}
}
}
}
or
function onLoad() {
var refreshMessage = g_form.getControl('short_description').value;
alert(refreshMessage);
if (refreshMessage == "test") {
g_form.$('task_cmdb_ci_service').ajaxOperation();
}
}
But, it is not working.
Any assistance in resolving the issue would be greatly appreciated.
Thanks and Regards
Kartik Magadum
- 604 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2023 03:08 AM