Relationship Query script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2025 07:22 PM
Hi Experts,
I've created a table called (u_asset_entilement) to display on the incident to entitle asset to user from incident table as attached screen shot.
Is there any way to only display the assets belongs to the company which is the same as the company of incident form?
I've created a relationship Query script, but seems not correct.
How to user relationship query script to narrow down the asset list?
In another hand, is there any other way to implement this requirement besides the relationship query script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2025 08:21 PM
how is the Asset field added on form? that field refers to which table? alm_asset?
Is it an embedded list? If yes then that's not how your relationship query script will work
If it's field on incident form then it should work fine
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2025 10:41 PM
Hi Ankur,
Thank you for your reply.
I added the table(u_asset_entilement) list to incident form as below.
I know, maybe the relationship is not correct for this requirement. Is there any other solution can implement my requirement? (Only display the asset list belong to the company in the incident form?)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2025 10:46 PM
so it's an embedded list as I thought earlier.
what's your business requirement actually here?
You want to see the related list -> if yes then on u_asset_entilement table are you using the correct field
in your addQuery() it should be u_asset and not asset
current.addQuery('u_asset.company', parent.company);
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2025 10:55 PM
Business Requirement is:
Support Center can add multiple assets to this incident form to assign assets to different users.
That's why I created a new table(u_asset_entilement) to record these entitlement.
but when they click the magnifier button to select asset from alm_asset table, hope this list can only display the asset list which belongs to specific (the company in the incident form) company like below screen shot.
Is there any way can implement this?