want to create records in multiple custom tables from one record producer form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2022 04:05 AM
I have a requirement like a record producer form that contains a Request Type select box variable. Users when select the choice of that Request Type variable, then a record should get created in that table.
Eg: 'Inquiry' and 'complaint' are two choices and they are also tables. When the user selects 'inquiry' as the Request Type choice in the record producer form, the record should be created in the inquiry table. In this case, record should not be created for the table that is given in record producer form it should only be created in the table of selected choice.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-12-2022 04:51 AM
Well it sounds like the records in question are Records, so I don't think Tasks would work (apart from extending Task and setting up a proper scoped application)
I would create a single table for this process, and just have the Complaint and Request as types. That way you can contain the data in the same table, use one record producer, and you can utilise views and view rules to render forms as required based on the type.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2023 03:34 PM - edited ‎06-28-2023 04:23 PM
I implemented this exact solution at a previous company.
We had a simple form for our users to contact us as the system admins - Ask a question opened a certain record, Submit a suggestion opened something else (like an Idea or Demand), Report Something Broken opened an Incident.
Use current.setAbortAction(true); as the first line in the producer script, that will keep the producer from immediately creating the record on the target table. Then script appropriately for the tables where you do want to create records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2025 10:27 AM
This combined with producer.portal_redirect is the way to go
current.setAbortAction(true);
var tableName = "your_table_that_you_want_to_use";
var otherTableGr = new GlideRecord(producer.getValue(tableName));
otherTableGr.initialize();
otherTableGr.setValue('short_description', producer.getValue('short_description'));
var newRecordSysId = otherTableGr.insert();
producer.portal_redirect = "?id=ticket&table=" + table_name +" &sys_id=" + sys_id;