Scripted Filters in Scoped Applications

Sabrina10
Kilo Guru

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

find_real_file.png

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:

find_real_file.png

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.

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

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


Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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()


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


Thanks, but I'm still seeing the same error when I put in new global.crqFilter.iCAB()