Need to populate Field message with Child incident count in Parent incident in field message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 10:14 AM - edited 08-08-2023 09:43 PM
Hi Developers,
I have a requirement like,
I created one new field in INC form called "Resolution" field type is choice. It contains 'New' and 'Existing' choices. This field i am displaying only in parent incidents. When user select 'New' in parent incident, If that parent incident have child incidents still active need to dispaly field message as " You have active child incidents, please close the child INC before closing parent INC" -- This message i need to show. If all the child incidents are inactive it did not show any message. Can any one help on the script part.
Example: If we have 4 child incidents for parent record, Info Message should be "You have 4 active child incidents, please close the child INC's before closing parent INC"
Thanks,
Praveen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2023 11:51 PM
You can use onchange client script for the same and following script
if(newValue == 'new')
return;
var gr= new GlideRecord('incident');
gr.addQuery('parent', g_form.getSysId());
gr.addQuery('active', true);
gr.query();
if (gr.next()) {
alert('Your Message');
}