Relationship to show Parent case on Requested Item form Related List?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 01:04 AM
Hi,
i tried to show Case record attached to Requested item as parent in related list of requested item form. But i am getting all the case records in related list.
Please correct my script to work properly.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 01:09 AM
Hi
There is problem in filter, first part should be field name in quotes and second part should be variable without quotes.
Try below,
current.addQuery("sys_id",parent.sys_id);
Let me know if you have any further queries.
Please mark this as Correct or Helpful if it helps.
Thanks and Regards,
Abhijit
Regards,
Abhijit
ServiceNow MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-20-2022 01:40 AM
If you have case field on request form which is referring to Case table then you should use below filter.
current.addQuery("case",parent.sys_id); //replace "case" with actual field name on request item table referring to case record
If you have "Request Item" field on Case form which is referring to request item table then you should use below filter.
current.addQuery("request_item",current.sys_id); //replace "request_item" with actual field name on Case form
Let me know if you have any further queries.
Please mark this as Correct or Helpful if it helps.
Thanks and Regards,
Abhijit
Regards,
Abhijit
ServiceNow MVP