- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2022 03:36 AM
Hello Everyone,
Thank you in advance for the help.
I have the scenario for mapping 2 fields from the record producer variable to another table in the backend.
I have used this script in record producer scripting part -
new sn_hr_core.script().funcname(producer.u_position_number,producer.eff);
and this code in the script include but not able to map the field -
ProjectDetailsCreation: function(pos,eff) {
var position = pos;
var effective = eff;
var projDetail = new GlideRecord('tablename');
projDetail.initialize();
projDetail.u_position = position;
projDetail.u_eff = effective;
projDetail.insert();
},
Can you suggest me the right solution?
Solved! Go to Solution.
- Labels:
-
Multiple Versions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2022 04:01 AM
Hi Komaldeep,
I don't think Script Include is required.
You can directly GlideRecord your table in Record Producer script:
var projDetail = new GlideRecord('tablename');
projDetail.initialize();
projDetail.u_position = producer.u_position_number;
projDetail.u_eff = producer.eff;
projDetail.insert();
Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2022 04:01 AM
Hi Komaldeep,
I don't think Script Include is required.
You can directly GlideRecord your table in Record Producer script:
var projDetail = new GlideRecord('tablename');
projDetail.initialize();
projDetail.u_position = producer.u_position_number;
projDetail.u_eff = producer.eff;
projDetail.insert();
Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2022 06:12 AM
Hello
I tried this solution, but it's not fulfilling the requirement (mapping is not taking place)
Thanks for your reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2022 07:07 AM
Hi Komaldeep,
Can you please share the script you wrote and what error or issue you are facing after this?
Is your variable names are correct and what is variable type of both variables and fields?
Thanks
Anubhav Ritolia
ServiceNow Rising Star 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2022 01:45 PM