Scripted Filters in Scoped Applications
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2017 05:07 AM
Here's what I want to do: Setup a definition in the CAB Workbench tool that shows me all the High Risk CRQs that are Pending Approval from the CAB.
We don't have a specific status for this, or any flag on the record that indicates that the CAB approval is still pending. We can tell this by querying the approval table for records where the status is Requested and the workflow activity name contains the word CAB. To do this, I thought to set-up a scripted filter using a Script Include. Which looks like this
Which works when I run it directly against the change_request table as a filter, so I know my logic is sound 🙂
But when I put javascript:new crqFilter().iCAB() in the additional conditions for the CAB definition, I get this error:
I thought maybe it was happening because the CAB Definition table is in the CAB workbench application and my script include is in the Global application, but then I updated the Script Include to be accessible from all application scopes. I also tried creating the Script Include inside the CAB Workbench application, but that failed as well with a similar error.
Any thoughts/ideas before I go down the path of putting a field on the change record to capture the status of the CAB Appproval? Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2017 05:26 AM
Hi Sabrina,
I assume you are using scoped app so can you try to use following and call the script include and check
add your scope also i.e. api name instead of crqFilter()
javascript:new crqFilter().iCAB()
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2017 06:27 AM
Thanks for replying. I don't quite understand your answer. CAB Workbench is an OOB plugin built in its own application. My Script Include is in the Global Application, querying tables also in the Global Application.
So are you saying, the filter needs to look like this: javascript: new Global crqFilter.iCAB()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2017 06:32 AM
Hi Sabrina,
Try calling your script include like this javascript: new scope_name.crqFilter().iCAB().
Thanks,
Ajay Limaye
Solugenix Corporation
PS: Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2017 06:52 AM
Thanks, but I'm still seeing the same error when I put in new global.crqFilter.iCAB()