Get Current SP Catalog Item on sys_user business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 12:29 AM
On the 'user query' business rule, we would like to amend the Condition to check/get where the query is being executed.
So, we would like the business rule not to run when it's being queried from a specific Catalog Item, i.e gs.getCurrentCatalogItem!=[sys_id/name].
We have not found any GlideSystem function that can achieve this for us. Please assist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 12:52 AM
Hi,
Do you want to change the query BR for a specific catalog ?
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 01:05 AM
Correct - we do not want it to run on a specific catalog item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2023 01:27 AM
Hi,
This can be achieved using the "getEncodedQuery" method of GlideRecord.
Sample code-
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2023 04:54 PM
Hi. I I tried this solution but it did not work. I also amended it as below, it also did not work:
var query = current.getEncodedQuery();
if (query.includes('u_catalog!=3af32f1a1b3079d82d421022b24bcbf4')) {
current.addActiveQuery();
}