- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 12:56 AM
Hello Community,
I have a simple query which I am not able to deal with.
My requirement is to populate the Short Description of Record Producer (which is created on table Security Incident) to Short Description of Security Incident.
I wrote the below line of code (line no 1):
Still it is not working 😞
Please help me out here.
Thanks in Advance,
Hritik.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 04:24 AM
Hii @Hritik If you know the short description of the producer then you can store this value in variable as a static eg var abc = 'xyz';
then you can use the current.short_description = abc;
//Use code in record producer script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 01:48 AM
@Hritik Do you need it for single record producer or multiple? And in which table you are submitting the record producer?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 02:22 AM
Hi @Akshata T
I need it for multiple Record Producers. Record Producer is being submitted to Security Incident Table(sn_si_incident)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 04:24 AM
Hii @Hritik If you know the short description of the producer then you can store this value in variable as a static eg var abc = 'xyz';
then you can use the current.short_description = abc;
//Use code in record producer script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 04:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2023 04:29 AM
try this and it will work
var gr = new GlideRecord("sc_cat_item_producer");
gr.addQuery("sys_id", cat_item.sys_id);
gr.query();
if (gr.next()) {
current.short_description = gr.getValue('short_description');
}
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