UI Builder - Show Display Only Form in new sidebar tab based on a reference field

Shane Huesdon
Tera Contributor

Hello,

I want it so that when the user clicks the new tab in the sidebar (think similar to agent assist or record information) the new panel will slide out and display the record from a particular reference field on the page.

 

The issue is that I cannot get the sys_id of that reference field into the required parameter of the display only component. I tried to use a data source to query for the current record, get the sys_id value from the reference but the data does not seem to be ready when the component loads.

If I hardcode the sys_id, works. If I hardcode the sys_id to a page property and bind that to the component's sys_id input, works. BUT I cannot get that sys_id to populate the page property. 
I have tried to set a CSP with a hardcoded value as the page property will take a CSP off @context.props but it seems like it doesn't set the page property in time for when the component loads.

Anyone done something similar and can explain the proper way to use a value on the page, such as the sys_id of a reference field and feed it to a component to render a result... ?

1 REPLY 1

Community Alums
Not applicable

Hi @Shane Huesdon ,

I checked your problem, you can write like @context.props.sysId the prop which contain your sys_id

SarthakKashyap_1-1717951445552.png

 

Or you can create one client script and call that body page load eventand try to console the sys_id wheather you getting the sys_id of current record you can add like 

 

console.log("API = " + JSON.stringify(api));
    console.log("API SysId = " + api.context.props.sysId);
    console.log("Event = " + JSON.stringify(event));

 

Result 

 

SarthakKashyap_0-1717951284527.png

 

Please mark my answer correct and helpful if this works for you

Thansk and Regards 

Sarthak