Icon/Picture in Record producer - facing issue for updating all record producers at a time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â06-17-2025 03:00 AM
Hi
we have 100+ record producers , so for icon/picture in record producer we want to update all of them at once
so created business rule and fix script
and followed this process
- Attaching the image in any one record producer
- Now going to sys_attachment table and copying the sys id of the above step
- Attaching the sys id in both business rule and fix script to run
However this is working fine for us but as these are instance dependent activity as these are manual steps for each instance, so here when one record producer is moving from instance to other with other development activity/for any issue then sys id of icon is changing everytime which is image is missing everytime
so to avoid this is there any other solution to update image/icon in all record producers at a time?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â06-17-2025 04:41 AM
there don't hard-code sysId
Instead do this
// get the attachment sysId using record producer sysId and then use that
var attSysId = '';
var gr = new GlideRecord("sys_attachment");
gr.addQuery("table_sys_id", "recordProducerSysId");
gr.query();
if (gr.next()) {
attSysId = gr.getUniqueValue();
}
rp.picture = attSysId;
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â06-17-2025 08:06 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â06-17-2025 09:03 PM
when i pasted this script and running the script , picture in all record producers are going to empty
Not sure where did i go wrong here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â06-17-2025 09:08 PM
please share your complete script.
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
â06-17-2025 09:19 PM - edited â06-17-2025 09:20 PM
Here in line 18 i am adding the record producer sys id in which i am adding the picture as first step