
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
05-02-2021 10:14 PM - edited 08-12-2024 09:04 AM
Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
Hi there,
Working on Instance Scan, and creating your own Scan Checks? Great! Though have you noticed, testing Scan Checks of type Column Type Check and Linter Check, take minutes? On an out-of-the-box instance this could be about 5 or 6 minutes, while on larger / older instances this could be easily 15 minutes or more. You might also have noticed this in the Live Coding Happy Hour which we did on Instance Scan. We tried performing a Linter Check, though didn't get to the result due to the time it runs ☹️.
A short article to share how to take a shortcut while testing the Column Type Check and Linter Check for Instance Scan.
Test Check
Out-of-the-box, a UI Action is available on Scan Checks which displays a form button called "Test Check". Basically, this executes a full instance scan just using the Test Check the user is currently on. A pretty nice out-of-the-box feature. The only thing, this test will take several minutes.
So how can we shorten the test time involved, when performing a Test Check? For example, you created a Linter Check, and wanting to test if it works, if the syntax is okay, testing a small adjustment, etc, how to shorten the test time?
Shortcut: Run Point Scan
Out-of-the-box, on Tables extended from sys_metadata, UI Action "Run Point Scan" is available on (active) records as a related link. Basically, this executes all scan checks against only the Process record the is currently on.
Let's say you're Linter Check is about checking for "new Object()" usage in the script (is a JavaScript bad practice), you could create a temporary Business Rule or Fix Script for example which contains "new Object()" in the Script field and perform the UI Action "Run Point Scan". While the Test Check performs a full instance scan and takes minutes, the Run Point Scan only checks the current record and just takes seconds! Your shortcut to test within seconds 😀.
Note: The UI Action does contain a condition, with amongst others "new sn_instance_scan.ScanUtil().isScannable(current)". I haven't found out the exact details in this yet, as we cannot access sn_instance_scan.
---
And that's it, hope you like it.
C |
If this content helped you, I would appreciate it if you hit bookmark or mark it as helpful.
Interested in more Articles, Blogs, Videos, Podcasts, Share projects I shared/participated in? |
Kind regards,
Mark Roethof
ServiceNow Technical Platform Architect @ Quint Technology
2x ServiceNow Developer MVP
2x ServiceNow Community MVP
---
- 1,699 Views