how to access the sys_id of sys_relationship from within a defined relationship script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2017 02:24 AM
I am building custom relationships and with that custom Edit buttons, (for good reason I wont go into now, you will have to trust me!)
So the Relationships themselves are filtering on a Type value, and there is a single UI Action which is displayed on each Related List which is switched to handle Type value.
This mapping between sys_relationship and type is consistent so I want to define it in a single place, and avoid hard coding sys_id into UI Action and relationships
The UI Action can get the sysparm_collection_relationship value from action.getGlideURI() - bingo!
The "Query With" field is used to build a query against current for the records to display in the list, and parent is the record on which the related list is displayed!
HOW can I get the same value from within the Relationship itself?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2017 02:27 AM
I am not sure if I understand the question but if you are asking about getting the sys id of the parent record in the relationship, then parent.sys_id will give you that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2017 02:36 AM
Thanks for reply,. sorry for lack of clarity.
I am asking how to access the sys_id of the relationship itself! (sys_relationship.sys_id)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2017 03:30 AM
RP object has some methods if I remember correctly that can be used to identify the type of the list and other such behavior. Maybe you can search using that and see if that has any method that can return you the information required.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-12-2017 12:10 AM
Thanks I have looked at these, and the most likely candidates getRelatedList() and relatedList do not seem to return anything meaningful 😕