Hi,

Glad you got a better understanding?

To be clear, the "documentation" is clear...what was explained is basic fundamentals of tables and their relationship. Once you understand that, you can work from that. Within your own post you already utilized or mentioned...GlideRecord to initialize a new record and insert it...and within the 2nd part of your post, you had stated you used: producer.first_variable_name, etc. for other things.

So it's unclear how in the first part of your question where you used a gliderecord to create a new record elsewhere and not use "producer.variable"...but then in the second part of your post, you did. Again, all pointing to just understanding the basic fundamentals.

Best of luck to you!

 


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

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

chrismcdevi
ServiceNow Employee

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. 

 

View solution in original post

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

chrismcdevi
ServiceNow Employee

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