The Now Platform® Washington DC release is live. Watch now!
on 10-23-2018 01:29 AM
Yesterday I uploaded a new CodeSearch application to the share: MS CodeSearch.
The application is based on the sn_codesearch application provided by ServiceNow which is also used in the studio search.
I appreciate any kind of feedback. You can comment this article or leave a comment/rating at the share. If you implement features by your own, please share them with us so that we can integrate them into the application.
The app is available for admins from the application menu:
You can input your search term and search for the code in predefined tables (see configuration).
You can then open and close the matchings. This is possible on table (1) and record (2) level. You can easily see the number of matching records and matching lines within a record.
The scripts are provided with the line numbers and syntax higlighting.
You can configure the tables and fields which should be searched in. Therefore you have to add/modify the entries in Code Search Tables (sn_codesearch_table).
All records for the Search Group "x_msgfi_codesearch.MS CodeSearch" are used by the Search application.
To add your custom tables/fields you can have a look at the method x_msgfi_codesearch.MS_CodeSearch().addAllTables(). This will add tables and fields with condition or script fields.
Hope you like it!
Regards
Sebastian
Nice piece of work Sebastian.
This is fantastic! Would it be possible to add and/or conditions?
Hi CSkaggs,
unfortunately this is not possible because the SN CodeSearch API does not provide something for it.
Everything has been working great, except for today.
For any search I try to perform, nothing happens and my browser console shows:
which comes from the .fail in function ajaxStartRequest(req)
Any ideas?
Hi sebastianreinmann,
We have activated the plugin in our instance, I am an admin but unable to see that from application menu.
Please find below screen shots:
Can you help me with this:
Thank you,
Priya.
Hi
did you install/commit our update set from share? Our code search application is not a normal system plugin you can activate.
Hi sebastianreinmann,
Sorry I didn't know this..
Can you suggest me with the steps to install that..
Thank you,
Priya.
1. Download the Update Set from Share: MS Code Search
2. Upload the update set (Go to Retrieved Update Sets, on the bottom of the page click Import Update Set from XML)
3. Commit the update set (https://docs.servicenow.com/bundle/newyork-application-development/page/build/system-update-sets/tas...)
If you are not familiar with update sets I recommend to have a look at it with one of your colleagues or partner who are familiar with it.
Hi sebastianreinmann,
Thank you so much for the steps.
I am aware of uploading the update set and previewing and committing.
I have just downloaded the xml file from the link you shared. It got downloaded as MS CodeSearch v0.
I have downloaded the xml file from the below download option. Let me know if it is wrong.
Thank you,
Priya.
Yes that should be correct.
I have also created a similar tool.
instead, it runs as a fix script and spits out urls.
its a small script and can be easily modified.
Hi Sebastian,
I have committed the update set.. And I can see the module from he navigator. But whenever i search some sys_id I am getting the below error.
Read operation on table 'sn_templated_snip_note_template' from scope 'Global' was denied. The application 'Global' must declare a cross scope access privilege. Please contact the application admin to update their access requests.
Could you please assist.
Thank you,
Priya.
Is this project dead?
Hi xiaix,
yeah kind of. Unfortunately we don´t have the time right now to improve/fix the current implementation.