sabell2012
Mega Sage
Mega Sage

NOTE: MY POSTINGS REFLECT MY OWN VIEWS AND DO NOT NECESSARILY REPRESENT THE VIEWS OF MY EMPLOYER, ACCENTURE.

DIFFICULTY LEVEL:   INTERMEDIATE

Assumes basic knowledge and/or familiarity of the Studio IDE in ServiceNow.

____________________________________________________________________________

Working inside of the Studio Integrated-Development-Environment (IDE) has some definite benefits!   However, there are some interesting omissions as well.   Some of these center around the IDE, while others around Scoped Applications in general.

Significant Advantages of the Studio IDE

1. Navigation and Tabbed environment

Let me gush about this for a bit!   The navigation bar gives us only what is in our application!   This makes is so much easier to find, open, and move between application files.   I am not sure how you are handling this right now, when you are developing in Global, but for me I would normally open several browser tabs to accomplish the tabbed bit.   The browser tab method can be painful, and if I have too many open, it becomes hard to find things.   So, this is a definite improvement.

find_real_file.png

2. Code Search

Here is the ONE thing I wish was available for Globally scoped applications as well!   You can search just your project, or you can search all of the code-base on your instance!   The function returns the results as a tab, and you can open any of the code found in the search to look it over.   NICE feature!

find_real_file.png

3. Quick Creation of Most Scripts and Files

The Create Application File button opens up a search form that allows you to pick from what can be created in the scoped world.   Simply navigate to the object you want to create, or begin typing it in the search text box.   Once you choose the object it is automatically generated in the Application Namespace, and opened as a tab in the IDE.   Once saved you will then see it appear in the left navigation bar.

find_real_file.png

4. Push to Repository - External Source Control

Another really great feature of the IDE.   You can link your project to an external repository like GitLab, GitHub, or BitBucket (to name a few).   Then either manually push your project updates, or they will be automatically pushed when you publish to the local Application Repository.   You can do branching of your project if you have to have a separate set of code (for example: maintenance mods).   In moving from branch-to-branch it will take a bit as the old application is removed and the new one is installed (slow), but still a nice feature.

find_real_file.png

5. Push to Internal Application Repository — Deployment

In a recent article (Community Code Snippets: Scoped Application Distribution) I talked about the various ways to deploy applications.   Well this is how and where it can be done in the IDE (File -> Publish).   The Company, Vendor Prefix, and App Name are all filled in for you (you cannot change the Vendor Prefix - this is a ServiceNow only editable field).   You will need to make sure that the Version number is one that has not yet been used, or when you click on the submit button it will detect the fact and kick it back to you.   It is considered a Best Practice to fill in the Dev Notes field.   Something describing what is in the release is usually preferable.

find_real_file.png

Outside of or Missing From the Studio IDE

So, what do I look at as needing improvement, or needing to be added to the IDE?   What follows are my observations.

1. For form Construction only the Form Designer is available (no Form Layout)

The Form Designer has a problem that keeps me from using it very often:   It does not automatically name new fields from the Label!   It can be great when moving fields around or creating/modifying sections.   When creating new fields I have to remember to go and rename a field or it will get saved with that automatically generated name that has nothing to do with the real function of the column.   Then I have to go drop the field and re-add it.   Ugh.

find_real_file.png

find_real_file.png

However, I am a big fan of the Form Layout tool because it automatically names a new field from the label. This is a nice time, and annoyance saver!  

Inside the Studio IDE I will not create fields with the Form Designer, but if I have to tweak where things go it is useful.   I will will create new fields in the Table form (where it DOES automatically name a new field from a label).   Anyway, you get the idea.  

find_real_file.png

2. Previous number check not done when you open the Publish form in the IDE

So, not sure why this was not included as a feature inside the IDE.   It works fine from outside via the System Application -> Applications properties form (the "Make App available..." link).   This is basically an inconsistency in the interface.   If you get it wrong and try to re-use a number you will only find out about it after you attempt to publish; the IDE will throw up an error, and ask you to change the version number before continuing.

From inside the IDE:

find_real_file.png

From the Properties Page:

find_real_file.png

Which does this; which is quite a bit friendlier:

find_real_file.png

3. Can only push to an Update Set via the Application Properties Form

So while I can't do this from inside the IDE, I can do it outside through my Scoped Application's properties page.   You can only push the project to an update set if you navigate to System Applications -> Applications and go into your Application's property page.   I would like to have this in the Studio.   I do a lot of deployment to not-my-company instances, and it would be handier from inside the IDE.

find_real_file.png

4. Testing of any part of the application

In order to test your application you will need to jump out of the Studio IDE.   All testing has to be done on the instance itself.   It would be nice to be able to trigger a test of a form or table modification from inside the IDE!

5. Cannot protect script Intellectual Property

In my article (Community Code Snippets: Scoped Application Distribution) I describe this particular issue.   You can only protect your code from prying eyes if you push it out to your local Application Repository or the ServiceNow Store.   Otherwise, you cannot protect your hard-earned, hard-to-write code.   It is only possible to deploy to other not-your-company instances via the update set mechanism, and this does not contain any IP protection whatsoever.

6. Cannot add Globally scoped files to your project

So basically anything Globally scoped is anathema in the Studio IDE.   You can't add Globally scoped files to your application, but you can add them as data (see #11 below).   This is a real problem especially if you have to create Globally scoped scripts to handle things that scoping will not (such as Package calls - see #8 below).

7. Cannot have a Globally scoped Studio application

I would really, REALLY like to have the ability to organize my Globally Scoped applications in the same manner is my Scoped applications!   I consider the Studio to be a great tool, but it would be even better if it allowed me this functionality!   Perhaps do this, but don't allow me to deploy to the ServiceNow store?   I would like to toss the Update Set process altogether, and this would allow me to do that!   So now, as a developer, I live between two development worlds: The old Global (which is being called legacy out on the development community), and the new: scoped.   I am seeing the vast majority of new development being done in Global still, so I think it is a bit premature to call this legacy.

8. Scoped applications do not accept any of the Java libraries!

I would like to have a list of what is not available inside of Scoped applications.   Instead I am compiling one as I go along.   Nothing about it in the online docs (other than gs.log and Package calls not being allowed).   Anyway, nothing with "Package" on it is available.   There goes Packages.Java.Lang, one of the most useful libraries we have on the platform!   There are several things that do work, but they are mostly from the Glide side of things.

9. Scoped applications do not accept many of the Global ServiceNow Libraries (JSUtil, J2JS)!

Well, mostly because of #8, we lose several useful JavaScript built-in Global libraries.   I have ended up dissecting JSUtil and extracting code into a Scoped Application Library of my own to get back this much used functionality.   I was able to mostly (sans Packages.Java.Lang.String) get back the JSUtil.nil() and .notNil() functions which are heavily used by the ServiceNow Global base code, and which I find are much more reliable than good ol' gs.nil().   Just saying.

10. Cannot Merge Source Control Branches

While I can create branches of my application in my external repository (i.e. GitLab); I cannot merge them.   BTW, it doesn't work to go merge them in the repository itself then download the "new" merged copy back to your instance via the Studio.   ServiceNow places the various components of your project out in the repository as a series of xml files, and merging these does not merge the actual differences.   The merge really would have to happen back in the Studio.   This bit of functionality would round out most of what needs doing with Source Control.

BTW, for really great reading on this topic, Microsoft has several patterns on branching and merging that do a good job explaining why both are necessary to development:

Chapter 5 — Defining Your Branching and Merging Strategy

Branching and Merging Primer

find_real_file.png

11. Adding data to the project

This is a cool, but little known feature of the External portion of the Studio.   It is not available from the IDE as you have have the data listed (which you can't do in the tool).   You have the ability to go to a list view and add records as data to your project.   Simply right-click on any List View header (in List v2), or in the tri-lipse (hamburger) button in List v3, and choose the Create Application Files option.     This will then ask you how you want to add the listed data to your Scoped Project.   BTW, this is the trick for adding Global Scripts to your deployment package.

find_real_file.png

find_real_file.png

And that is all I have on this topic for the moment!   The Studio IDE is a great tool, and I would sure like to see more integration!   🙂

Steven Bell

Combined Logo Graphic_Operations.png

For a list of all of my articles:   Community Code Snippets: Articles List to Date

Please Share, Like, Bookmark, Mark Helpful, or Comment this blog if you've found it helpful or insightful.

Also, if you are not already, I would like to encourage you to become a member of our blog!

3 Comments