- 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
01-30-2021 10:18 AM
- "related_list_table" is a valid table?
- If reporting party field is a field why are you setting it in role field?
grReportingParty.setValue('role', 'Reporting Party');
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?- No it will not conflict
var notes = producer.first_varblename;
notes += "\n"+producer.secondvariblename;
notes += "\n"+producer.thirdvariablename;
current.description = notes;
this script seems right
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2021 11:41 AM
Thank you Pranesh.
- "related_list_table" is a valid table? --> Here, this is an example
- If reporting party field is a field why are you setting it in role field?
grReportingParty.setValue('role', 'Reporting Party'); --?this is just another example
But my question is how do I use the producer function to map it to fields in the Related list table?
I am looking for something like
producer.variableName = field from the related list?
Once again, thank you. appreciate your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2021 10:55 PM
Do you have variables defined for Requested by and Requested in Record producer, if yes then you can try below
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.setValue('requested_forVARNAME',producer.requested_ForVARNAME);//CHANGE THE FIELD NAME and VARIABLE NAME
grReportingParty.setValue('requested_byVARNAME',producer.requested_byVARNAME);//CHANGE THE FIELD NAME and VARIABLE NAME
grReportingParty.insert();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2021 12:18 PM
Thank you so much for your reply and this is really helpful.