How to open the catalog from a list action?

jose_quinonez
Giga Guru

Hi,

I am working in the Service Operations Workspace.

I opened the Request/Open Items list.

 

I created a list action called "New Req". I just want it to open the catalog items.

It is implemented as client script.

This is the client script code:

function onClick() {
        var params ={};
        g_service_catalog.openCatalogItem('sc_cat_item','-1', params);
}

 

But it is not working from the list.

I know it works from a form, like the interaction form when you click on Create request.

 

¿How can I make it work from the req_item list?

 

Thanks

 

 

 

jose_quinonez_0-1718937316260.png

 

 

3 REPLIES 3

Dnyaneshwaree
Mega Sage

Hello @jose_quinonez ,

If there is already created "'New" button to create new req/RITM then why you want to create new one? 
Also, records are always created by filling info in the form so, why you want to create it in list view?
Have you add this logic in UI action?

Thank You!

Please accept my solution if it works for you and thumps up to mark it as helpful.
Thank you!!

Dnyaneshwaree Satpute
Tera Guru

Hi,

I want to open the catalog so I could see categories and choose an item.

If you open an interaction you can click the Create Request button UI Action, and then it opens the service catalog. I want to do the same, except that I don't want the interaction form to be open. I want to call it from the req_item  list.

Thanks

Community Alums
Not applicable

Hi @jose_quinonez ,

I tried your problem in my PDI you can try below solution 

SarthakKashyap_0-1718955355463.png

You can create one catalog item with your questions in there and you can use that catalog item and pass the sys_id.

var cart = new Cart();
var item = cart.addItem("485bce8293c28a500d5170918bba10f1"); // sys_id of your catalog item
cart.setVariable(item, 'mouse', true); // Add your variables this way
cart.placeOrder();

Implemented as : Server Side

Result 

New RITM is created with given variables answer 

SarthakKashyap_1-1718955517993.png

 

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

Thanks and Regards 

Sarthak