- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2021 03:07 PM
Hi Everyone
I need to map 'Requested by' and 'Requested for' fields from the Input form and map it to fields in the Related list table.
I used a small script, in the scripting section of the producer, 'Requested by' from the form should map it to reporting party field in the related list.
var grReportingParty = new GlideRecord('related_list_table');
grReportingParty.initialize();
grReportingParty.setValue('parent_case', current.sys_id);
grReportingParty.setValue('role', 'Reporting Party');
grReportingParty.setValue('type', 'Employee');
grReportingParty.insert();
- Any help would be appreciated Not too sure how to use this
producer.Requested_by = ReportingParty;
2. Second question - I have created many variables and have mapped it to fields on the parent case. But I also used the Script section of the record producer to make all the questions available in the notes section. Will there be a conflict if we use both? because, when I used only variables to map, it was working but now it is not quite working.
var notes = producer.first_varblename;
notes += "\n"+producer.secondvariblename;
notes += "\n"+producer.thirdvariablename;
current.description = notes;
Could you please help me with this? Your help is greatly appreciated.
Thank you
Shubha
Solved! Go to Solution.
- Labels:
-
Security Incident Response

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2021 02:38 PM
I'm not sure what tables you are working with.... but I'm pretty sure there is a Business Rule on one of the tables you are inserting the record into. That business rule is most likely causing the extra case to be created.
You will need to identify the Business Rule(s) that are causing this to happen and see if you can work around them somehow. (i.e. do not trigger them).
If you using a GlideRecoord you can consider using .setWorkflow(false) which prevents the business rule from running.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2021 10:50 AM
Hi Chris,
I am opening this again, as we are facing an issue. from the record producer, including the related list script, all the fields are mapped properly and looked good. But, along with the correct record, there is another case created with broken(empty) table fields and when I checked the log I saw these messages:
org.mozilla.javascript.EvaluatorException: GlideRecord.setTableName - empty table name (file:/var/glide/nodes/16000/webapps/glide/itil/WEB-INF/ui.jtemplates/set_attachment_jvars.xml.5; line 3)
EvaluatorException(JavaScript evaluation error on:
var plugin_enabled = GlidePluginManager.isActive('com.snc.documentviewer');
var prop_enabled = gs.getProperty('com.snc.documentviewer.enable_document_viewer','true') === 'true' ? true : false;
var gr = new GlideRecord("");
var attr_enabled = gr.getED().getBooleanAttribute("use_document_viewer");
plugin_enabled && prop_enabled && attr_enabled;
)
I found there was an thread about the same, but could not open the KB article.
Any suggestions? why there is an extra case created? If I comment out the script portion for the related list, it works.
Thank you in advance for your help
Shubha
https://hi.service-now.com/kb_view.do?sysparm_article=KB0547210&sysparm_order=7cdd130c87ccc100957bb3aeef434dfa&sysparm_topic=Known+Error+Database

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2021 02:38 PM
I'm not sure what tables you are working with.... but I'm pretty sure there is a Business Rule on one of the tables you are inserting the record into. That business rule is most likely causing the extra case to be created.
You will need to identify the Business Rule(s) that are causing this to happen and see if you can work around them somehow. (i.e. do not trigger them).
If you using a GlideRecoord you can consider using .setWorkflow(false) which prevents the business rule from running.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2021 03:19 PM
Thank you so much for your time on this. There was only one business rule and I made it inactive. But that did not help.
On the record producer script, for the related list table, I have used the From your example: (RLR_table) I have tried to insert the record on the related list table.
SO, this is creating a case with the related list -> looks good but I have extra case and the errors on the log file.
Ours is On-prem on Orlando. I will keep debugging on this. I will try .setWorkflow(false) and see if this helps.
Thanks again

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2021 06:31 AM
It is hard to understand what you are fully doing....
But I was wondering....
maybe try:
current.setAbortAction(true);
As the last step.
https://community.servicenow.com/community?id=community_question&sys_id=29fe57d4db49681066f1d9d968961978
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2021 02:14 PM
I am so sorry for the delay in replying, to your response. We were debugging this and were not too sure but you are super!! You guessed it right about the business rule!! We figured an business rule which was on the related list table had an update, which made the cases to trigger. Don't know how to thank you enough. Thank you so much for helping me resolve this issue. Tons of thanks. Have a great weekend.