Need to understand how sc_cat_item_company_mtom (Available for companies) table is related to display catalog items on portal

sangz
Kilo Contributor

Hi All,

We have a requirement in that we need to show only catalog items which are present in sc_cat_item_company_mtom (Available for companies) table.

In this table we can create records in that we need to mention catalog item and company. If the login person is a part of the company which is in sc_cat_item_company_mtom table then we need to show the respective catalog item for the customer.

find_real_file.png

How to achieve this?

Thanks in advance,

Sangz

10 REPLIES 10

Harish KM
Kilo Patron
Kilo Patron

Hi you can use User Criteria for this approach. I think sc_cat_item_company_mtom  is depreciated by Servicenow. Not sure though, but this is something you can do with help of User Criteria and Add the user criteria under available for related list on Catalog item

Regards
Harish

sangz
Kilo Contributor

Hi Harshith,

 

Yes, even we thought of going with user criteria but for example if we add 200 records into sc_cat_item_company_mtom then we should add user criteria for all the catalog items.

Is that feasible solution?

Thanks,

Sangz

Hi you need to get the company list of users and check if logged in User is part of the company and return true from User criteria advanced script. Store all the company names in a array and you can check if logged in User is part of the company.

 

Regards
Harish

sangz
Kilo Contributor

Hi Harshith,

Yes I wrote that script but how to adopt that in portal. I mean in widget we need to right it right?

In that script fist i'm gliding contact relationship table and storing all the companies in one array

after that i'm checking those companies are present in mtom table or not if its present then i'm storing the sys_id of all the catalog items in one array and category of that catalog item in  another array.

find_real_file.png

where exactly should I write this code?

Thanks,

Sangz