You are on page 1of 6

28/02/2017 DevelopingapplicationsinStudio

Developing applications in Studio

In the previous chapter, we started building the Hotel application. This included de ning
the data storage needed by building tables, exploring the dictionary, and creating
relationships. All these items are in different menus, meaning you need to keep navigating
to different places, without a consistent overview.

ServiceNow Studio is designed to help with this. It provides a single location where all the
con guration for the app is collected together. This lets you jump among the things you
are working on without the clutter of con guration from other areas. Here's how to use it:

1. Open up Studio by navigating to System Applications > Studio, click on the Go


button under Open Studio, and then click on Hotel in the Load Applications
dialog.

2. Studio collects all the con guration together, making it easy to nd existing
artifacts and create new ones. The Application Explorer sidebar contains a
categorized list of Application Files, while the Go To and Code Search
capabilities lets you jump right to what you want.

3. Using Application Explorer, click on Check-In Table under Tables in Data Model.

https://www.packtpub.com/mapt/book/virtualization_and_cloud/9781786465955/2/ch02lvl1sec15/Developing+applications+in+Studio 1/9
28/02/2017 DevelopingapplicationsinStudio

You should see a familiar interface-the same Table form we used in Chapter 1,
ServiceNow Foundations-to add elds to.

4. The Go-To search bar is really useful for quickly switching to other artifacts.
Click on the Go-To link in the top right, or use the Control + Shift + O (Cmd +
Shift + O on Mac) keyboard shortcut, and search for CheckIn . Several

relevant options are available, essentially ltering the items available in


Application Explorer. For now, click on the Form option.

https://www.packtpub.com/mapt/book/virtualization_and_cloud/9781786465955/2/ch02lvl1sec15/Developing+applications+in+Studio 2/9
28/02/2017 DevelopingapplicationsinStudio

Notice how Form Designer has opened in a new tab, keeping the Table form
accessible with a single click.

5. Click File, then Settings to open up the Application Settings form. This gives
many options that control how the application works. Several will be discussed
later in this chapter, others as we work through the book. For now, let's make our
lives easier by associating the Hotel menu (that appears in the left menu) with
our application. It sets the default whenever we create a table. Set the following
eld, then save.

Menu: Hotel

https://www.packtpub.com/mapt/book/virtualization_and_cloud/9781786465955/2/ch02lvl1sec15/Developing+applications+in+Studio 3/9
28/02/2017 DevelopingapplicationsinStudio

6. Another fantastic feature of Studio is Code Search. While we will be


investigating scripting in the next two chapters, it would be remiss to not point
this out. Click on the link in the top right, or press Control + Shift + F (Cmd +
Shift + F on Mac) to bring up the dialog. Search for TableUtils and select the
Search in all applications checkbox to see how it can scan over 20 scripting
tables in one go. I can't tell you how much time this saves!

Ensure you try out all the features of Studio. Letting you easily and quickly nd and switch
between all the items you are creating will really help you accelerate your application
development.

Recording les

Application Explorer shows all the application les associated with the application. Every
time you make any con guration, an entry is made in the Application Files
[ sys_metadata ] table. This associates the table, form, e-mail noti cation, or script that
you made with your application. But which application is that? Let's nd out:

If you are using ServiceNow Studio, the conguration you make is always
associated with the application you opened Studio against (this is listed in the top
right of the Studio interface).

In the standard interface, the application you are editing is the one you
selected in System Settings. This can be changed by clicking on the cog icon
next to your name, going to Developer, and then choosing it from the Application
Menus selector. (It's much easier if you enable the Show application picker in
header option.)

https://www.packtpub.com/mapt/book/virtualization_and_cloud/9781786465955/2/ch02lvl1sec15/Developing+applications+in+Studio 4/9
28/02/2017 DevelopingapplicationsinStudio

Tip
Consider the application le's application as metadata that provides the instance
with information about the conguration.

Follow these steps:

1. To see what Application Files are created, click on the blue Create New
Application File button in the Studio interface. The dialog that appears does a
much better job of organizing the platform-con guration options into logical
categories than the standard application navigator, providing help text and great
ltering. Notice how there are almost 80 options-and that doesn't even cover
them all! Close the dialog when done.

2. Normally, you don't need to worry about the application les and the data they
store. The instance looks after it. However, let's open one up to see how it works.
The Application File for a con guration artifact is always accessible through the
menu of the record. Open up the Check-In table record (use the Application
Explorer or Go To search, or just click on the tab if it's open), and then choose
Show File Properties from the Additional Actions menu.

https://www.packtpub.com/mapt/book/virtualization_and_cloud/9781786465955/2/ch02lvl1sec15/Developing+applications+in+Studio 5/9
28/02/2017 DevelopingapplicationsinStudio

Several interesting options are available in the application le. The related lists at
the bottom show any related items (the elds in the Check-In table are listed, for
example), while Versions stores the changes that the record has gone through.

Tip
Versioning is incredibly useful for scripts. It can show you, using a line-by-line
difference view, how your code has evolved over time. Chapter 10, Packaging
with Applications, Update Sets, and Upgrades dives into this-and the
Protection policy eld-in more detail.

https://www.packtpub.com/mapt/book/virtualization_and_cloud/9781786465955/2/ch02lvl1sec15/Developing+applications+in+Studio 6/9

You might also like