I want to add new record to related list using script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2025 12:35 AM
Hi,
I have requirement to map the reference field to related list for that record.
Risk event
i have custom field citation takeplace --> reference field to citation
in that risk event i have related list also for ciitation
so, value in custom field citation needs to map to the citation related list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2025 01:01 AM
Hello @Arun_Manoj ,
Create a custom relationship definition from System Definition > Relationships.
Below is sample example try modifiying it according to your requirement.
Applies to = "Incident"
Queries from: "your_custom_table" (Problem in this example)
As a script, you can do yours similar to the following: (Parent = Incident, Current = Problem)
(function refineQuery(current, parent) {
current.addQuery("sys_id", parent.problem_id); // Replace problem_id with your custom reference field
})(current, parent);
You can add then your custom related list to the incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2025 04:46 AM
@Arun_Manoj wrote:Hi,
I have requirement to map the reference field to related list for that record.
Risk event
i have custom field citation takeplace --> reference field to citation
in that risk event i have related list also for ciitation
so, value in custom field citation needs to map to the citation related list
The most effective way to map a reference field to a related list is by using a server-side script, such as a Business Rule. This script should be configured to run after a record is updated, specifically when the reference field's value changes. The script's logic will then take the unique ID of the selected record from the reference field and automatically create a new entry in the table that populates the related list, thereby linking the two records.