How to change the popup vieww of a reference field in Service Portal.

sailaja2
Kilo Contributor

Hi All

We are showing a Record producer in the Service Portal. It has a reference field pointing to cmdb_ci table. if we select any CI, then we will see the reference icon (i).

If we click on it, we are seeing default view.

How can we change it to a different view?

We have sys_popup view, sp view. But, we are not seeing these views. Even if i add view=sp in the url, i see the same default view.

Any help is really appreciated.

 

1 ACCEPTED SOLUTION

Domenic Horner
Tera Expert

Hey,

You can add the CSS:

.add-on { display: none; }

To and page/widget that you'd like to hide the reference icons from.

I haven't found any way to modify the view that is displayed in them. (as Portal doesn't respect a `sys_popup` view)

View solution in original post

4 REPLIES 4

Domenic Horner
Tera Expert

Hey,

You can add the CSS:

.add-on { display: none; }

To and page/widget that you'd like to hide the reference icons from.

I haven't found any way to modify the view that is displayed in them. (as Portal doesn't respect a `sys_popup` view)

Andre Kosak
Tera Contributor

Reference fields are being rendered with the angular directive <sp-reference-field>, which is using the formModel.view value as a value for defining the view for popup. This directive is typically used inside of <sp-model> directive. There is no OOTB widget where you would find an example of defining the view, but you could pass the value from the parent widget where <sp-model> (and<sp-reference-field> inside of it) is being used.

Example: in widget "SC Catalog Item" or its clone add following statement after "data.sc_cat_item = $sp.getCatalogItem(catItemData);"

data.sc_cat_item.view = 'ess';

This should make all reference fields on Catalog Items to use "ess" View.

I tried what was mentioned in your comment, but it is not working for me.

I have cloned the SC Catalog item and have added following line of code just below

"data.sc_cat_item = $sp.getCatalogItem(catItemData);"

//Added line of code
data.sc_cat_item.view = 'sys_popup';

and then included this cloned widget in sc_cat_item page.

Am I missing something?

Note: Sys_popup view exists.

Hi,

I have the same requirement, do you found a solution?

Thanks.