The Now Platform® Washington DC release is live. Watch now!

Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Sebastian R_
Tera Guru

MS CodeSearch Application

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.

 

Usage:

The app is available for admins from the application menu:

find_real_file.png

 

You can input your search term and search for the code in predefined tables (see configuration).

find_real_file.png

 

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.

find_real_file.png

The scripts are provided with the line numbers and syntax higlighting. 

 

Configuration:

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.

find_real_file.png

 

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

Comments
Paul Curwen
Mega Sage

Nice piece of work Sebastian.

CSkaggs
Giga Contributor

This is fantastic! Would it be possible to add and/or conditions?

Sebastian R_
Tera Guru

Hi CSkaggs,

unfortunately this is not possible because the SN CodeSearch API does not provide something for it.

xiaix
Tera Guru

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?

priyarao
Tera Guru

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:

find_real_file.png

find_real_file.png

 

Thank you,

Priya.

Sebastian R_
Tera Guru

Hi @priyarao ,

did you install/commit our update set from share? Our code search application is not a normal system plugin you can activate.

priyarao
Tera Guru

Hi sebastianreinmann,

Sorry I didn't know this..

Can you suggest me with the steps to install that..

 

Thank you,

Priya.

Sebastian R_
Tera Guru

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.

priyarao
Tera Guru

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.

 find_real_file.png

Thank you,

Priya.

Sebastian R_
Tera Guru

Yes that should be correct.

restevao
Mega Expert

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.

Universal Script Searcher

priyarao
Tera Guru

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.

xiaix
Tera Guru

Is this project dead?

Sebastian R_
Tera Guru

Hi xiaix,

yeah kind of. Unfortunately we don´t have the time right now to improve/fix the current implementation.

Version history
Last update:
‎10-23-2018 01:29 AM
Updated by: