How to open/preview reference field records in UI builder?

Maxim1
Tera Contributor

Basically ask the title asks: how do you open/preview reference field records in UI builder (see screenshot below)?

find_real_file.png

 

I've made a UI builder page using the OOTB Record template as a base. I've tried just using both the read-only template and using a fully customizable template but I have had zero success in getting the preview record and magnify glass buttons to work.

The buttons don't work for OOTB using the read-only template so that isn't good news.

When using the fully customizable template, I tried hooking into the Preview Record and Item Selected events on the record tabs component, to no avail. I added a client script that console logs a message as the event handler for those two events, but I never got the message to log in my console.

How do I get this to work? I'm assuming there is just some configuration I'm missing. Am I hooking into the wrong events? Am I putting the event handlers in the wrong place? (Right now I am putting them in the record tabs component, but is the proper way to do it to put them in the page-level event handlers or maybe into an event handler for a data source?)

As per usual, documentation is not helping.

5 REPLIES 5

JagjeetSingh
Kilo Sage
Kilo Sage

I know that this is coming from declarative actions.

Go to sys_declarative_action_assignment and Filter records with Action Modal= Field.

You'll see the actions labeled "Open Record". This is from where that icon is coming form.

I hope it helps in your investigation.

Jagjeet Singh
ServiceNow Community Rising Star 2022/2023

Maxim1
Tera Contributor

As an update: haven't completely figured out how to get this working but for the magnify glass button, it seems to have something to do with route=modal_ref_lookup on the sys_ux_app_route table.

I'm assuming with proper configuration and/or scoping, one could get it to work consistently.

For some reason, a lot of these kinds of records are made in Global scope even though I am working within a scoped app.

Hi Maxim, have you found solution for this? We have encountered the same.

Maxim1
Tera Contributor

Nothing yet. Been poking around at the Record page template to see if I can figure out how to make it work or be able to reproduce it in a scoped app.