- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2025 01:58 AM
How to create a record in a custom(not the target table) table when we submit a record producer?
Note: The table in which we are creating a record is not the target table.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2025 02:01 AM
Hello Buddy, there is a script field in record producer inside "What it will contain". There, you can write your code to create a record in a table if it is not the table in which we are storing the data.
Below is the script to do this
var var_name= new GlideRecord("tablename");
var_name.initialize();
var_name.field_name= producer.variable_name;
var_name.insert();
Please mark my answer helpful and correct if it helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2025 02:01 AM
Hello Buddy, there is a script field in record producer inside "What it will contain". There, you can write your code to create a record in a table if it is not the table in which we are storing the data.
Below is the script to do this
var var_name= new GlideRecord("tablename");
var_name.initialize();
var_name.field_name= producer.variable_name;
var_name.insert();
Please mark my answer helpful and correct if it helps you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2025 02:02 AM
Hello @HarshitaN ,
You can easily do it by making the changes in the table field. You can simply provide the any table name in which you want your record producer to be submitted.
Please refer the below screenshot.
Also, if you have any further doubts on it. Please let me know.
I appreciate if you mark my answer as accepted solution and give thumbs up, if it helps you.
Regards,
Abhishek Thakur
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2025 02:07 AM
you can use record producer script for this
OR
after insert BR on the target table on which record producer is defined
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