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  

Catalog item reference variable value not displayed in the portal cart

s_thore
Kilo Contributor

Hi,

Everything I describe below is on the service portal, but I can't find portal in the topics list.

I have a catalog item with a reference variable. The available values for this variable are filtered depending on the answer to another variable, through the following scripted reference qualifier :

javascript:"assigned_to="+current.variables.u_requested_for


It works as expected when I create a new item and fulfill the u_requested_for field first, but if I add the new item to the cart, then edit the cart item, the reference variable field is displayed empty. As it's a mandatory field, it's cicrcled in red and listed in the "Required information" frame.
When editing the cart item, if I re-select a value in the field, then click "update cart", the field will be displayed empty again after reloading the page.

If I add logs in the server script of the catalog item widget, I see that the field contains a sys_id, but somehow this sys_id cannot be used by the widget. The RITM has a value for the variable, so it's a matter of displaying the value on the portal, not storing it in the database.

The catalog item widget is a clone of the oob widget with ID=widget-sc-cat-item-v2.

 

I guess the cause is related to the javascript reference qualifier, as other reference variables on the same cat item, without javascript qualifiers, work correctly, and I encounter the same incident on other cat items with reference variables using javascript ref.qual.

How can I have the name of the referenced object in the field, when editing the item in the cart ?
Do I have to add a script for every reference field with scripted ref.qual, in the catalog item widget ?

 

Thank you for reading.

 

 

1 REPLY 1

hartr
Giga Contributor

I get the same issue with a select box that I am populating with addOption.  Displays OK when editing the cart in UI16, but goes blank when editing the cart item in the portal