- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-20-2022 02:09 AM
Hi Experts,
I have one requirement like "When I create a update set that name should be unique. Its not be same as existing update set. if existing and newly created update set is same need to notify while saving with error popup " Update set name is already in our records so please change the name "
And Duplicate update sets should be removed or renamed if being used for active development.
I am not sure how to be proceed. Need your assistance on it. Any help will be appreciated.
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā09-20-2022 02:20 AM
Hi,
you can also make Name field on "sys_update_set" as Unique at dictionary level
BR Script If required
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var gr = new GlideRecord("sys_update_set");
gr.addQuery("name", current.getValue('name'));
gr.setLimit(1);
gr.query();
if (gr.hasNext()) {
gs.addErrorMessage("Please give unique update set name.");
current.setAbortAction(true);
}
})(current, previous);
regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-08-2025 07:00 PM
Can you post a new question and tag me there as this is an old thread?
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā03-01-2024 10:01 AM
Hey Ankur Thanks for this script