How to restrict product model records based on selection particular account in CSM portal in SNOW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2024 10:40 PM
Hi Community,
I have created new case form in CSM Portal and we have fields like Accounts and product (taken reference as Product model table)
we need to restrict Product based on selection of each particular account (means if we select one particular account it will show only that particular account products on Product field
If we can restrict the field via script include and add here advanced reference qualifier, could you please share the script include code.
Thanks,
Srinivasu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2024 12:43 AM
@Srinivasu2
then use this code
getSoldProductRefQual: function(account) {
if (gs.nil(account))
return;
var gr = new GlideRecord("cmdb_model");
gr.addQuery('account', account);
gr.query();
var listOfSoldProducts = [];
while (gr.next()) {
if (gr.canRead())
listOfSoldProducts.push(gr.sys_id + '');
}
return "sys_idIN" + listOfSoldProducts.join();
}
Please hit helpful and accept this as a solution if it solved your problem.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 06:28 AM
Hi,
Could we able to restrict Product models based on some user persona's, say some roles or groups...
When "requested_for" selected has some role(say "X") in service catalog, only some Product Models should be shown. like how we have user_criteria for "service catalog".
Thanks,
Vani