User Criteria
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 09:07 AM
Hello,
Brief background: We support multiple companies within a single SNOW instance, and most of the companies have their individual catalog items. For that, we utilize "User Criteria". We also have an L1 desk that handles all of the companies, and this group has access to all of the catalog items in our instance regardless of the company. We are having issues when they open a request for Company A for Computer A that is only available for Company B. Is there a way to restrict the creation of a request using the "requested for" user's company name to prohibit that request from being submitted?
Thanks in advance
- Labels:
-
Service Catalog
-
Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2024 09:32 AM
Hi You can try the below code
On before business rule with insert/update
(function executeRule(current) {
// requested item (e.g., Computer A) and its company
var requestedItemCompany = current.cat_item.company.getDisplayValue();
// associated with the requested for user
var requestedForUserCompany = current.requested_for.company.getDisplayValue();
if (requestedItemCompany !== requestedForUserCompany) {
gs.addErrorMessage('You are not authorized to request this item.');
current.setAbortAction(true); // Abort the submission
}
})(current);
Thanks and Regards
Sai Venkatesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2024 05:39 AM
Thank you, Sai. Apologies for the delayed response.
This works. The only issue is that our support desk usually raises requests (catalog items) via Workspaces from an interaction. The message does pop up and does not allow the requested item to go through, but it does show that the request was submitted even though the request was not created. See attached
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2024 05:58 AM
Can you close the question by marking as solution so that It will be helpful for others in the community
Thanks and Regards
Sai Venkatesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2024 06:18 AM
Hi @Marcelo Pedrey1 ,
Seems like you have to review the current implementation logic and update the catalog item for company check logic.
Writing the BR which work on backend to stop such record creation not a good solution becuase the portal message and actual work will be in mismatch condition.
Additionaly, the L1 team need some training on such senario to avoid such cases.
-Thanks,
AshishKM
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution