官术网_书友最值得收藏!

Developing applications in Studio

In the previous chapter, we started building the Hotel application. This included defining 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 configuration for the app is collected together. This lets you jump among the things you are working on without the clutter of configuration 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 configuration together, making it easy to find 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.

    You should see a familiar interface-the same Table form we used in Chapter 1, ServiceNow Foundations-to add fields 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 Check-In. Several relevant options are available, essentially filtering the items available in Application Explorer. For now, click on the Form option.

    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 field, then save.
    • Menu: Hotel
  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 find and switch between all the items you are creating will really help you accelerate your application development.

Recording files

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

  • If you are using ServiceNow Studio, the configuration 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.)

Tip

Consider the application file's application as metadata that provides the instance with information about the configuration.

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-configuration options into logical categories than the standard application navigator, providing help text and great filtering. 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 files 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 configuration 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.

    Several interesting options are available in the application file. The related lists at the bottom show any related items (the fields 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 field-in more detail.

主站蜘蛛池模板: 那坡县| 南丰县| 迁西县| 大冶市| 荃湾区| 灵山县| 昌江| 沁水县| 河曲县| 乌拉特前旗| 保靖县| 北海市| 长寿区| 龙岩市| 蓬安县| 临澧县| 和林格尔县| 农安县| 克东县| 雷波县| 白水县| 雷波县| 绩溪县| 庄浪县| 富蕴县| 如皋市| 惠水县| 东山县| 内丘县| 仪征市| 遵义县| 绥棱县| 丹江口市| 油尖旺区| 庄河市| 基隆市| 论坛| 永嘉县| 泌阳县| 娄底市| 通山县|