Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

how to access the sys_id of sys_relationship from within a defined relationship script?

mrswann
Kilo Guru

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?

5 REPLIES 5

mrswann
Kilo Guru

I also want to be able to hide a UI Action based on the related list sys_id