
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2018 06:46 PM
Hi There,
I have a requirement to include a related list on our requested items that displays the assets assigned to the requested_for user. We have a similar relationship already created on our incident table and it works fine; however when recreating it on our requested item table it shows all assets and not the ones assigned to that specific user.
Here is how I have set up the relationship
Name: Caller Assets
Applies to Table: Requested Item (sc_req_item)
Queries from table: Asset (alm_asset)
Query with script:
(function refineQuery(current, parent) {
current.addQuery('assigned_to', parent.requested_for);
})(current, parent);
I used a similar query as our incident table relationship, but changed it to parent.requested_for rather than parent.caller_id to represent the 'requested for' person in the RITM rather than 'caller' on an incident.
Any idea why it is not working?
Many thanks,
Anna
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2018 08:01 PM
Hi Anna,
Try modifying your query as shown below, it should fix your issue.
(function refineQuery(current, parent) {
current.addQuery('assigned_to',parent.request.requested_for);
})(current, parent);
Mark Correct if this solves your issue. Hit Like/Helpful based on the impact.
Regards,
Udhay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2018 08:01 PM
Hi Anna,
Try modifying your query as shown below, it should fix your issue.
(function refineQuery(current, parent) {
current.addQuery('assigned_to',parent.request.requested_for);
})(current, parent);
Mark Correct if this solves your issue. Hit Like/Helpful based on the impact.
Regards,
Udhay

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2018 08:36 PM
Thanks Udhay, this has worked perfectly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2018 08:07 PM
Hi Anna
OOB requested_for field is available on the sc_request table not on the sc_req_item table . This is the reason why it is not working. Please check if there is any field on the request item table for requested for field.
Regards,
Harsh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2018 08:37 PM
Thanks Harsh, I've got it working using Udhay's recommended change.