applications(app creator) servicenow

43
 PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information. PDF generated at: Sun, 03 Aug 2014 10:08:44 PST Applications

Upload: alad-pereira

Post on 03-Nov-2015

34 views

Category:

Documents


1 download

DESCRIPTION

Service now app creator Document

TRANSCRIPT

  • PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information.PDF generated at: Sun, 03 Aug 2014 10:08:44 PST

    Applications

  • 1Building Applications

    App Creator

    OverviewApplications represent packaged solutions for delivering services and managing business processes. ServiceNowincludes several standard applications, such as Incident and Problem. Administrators can also develop customapplications to meet business needs.The app creator provides these features for building and managing custom applications: Allows you to associate configuration recordssuch as tables, business rules, client scripts, or UI pageswith an

    application. Associates records with an application and detects cross-application conflicts as you develop. Provides a dedicated place for creating, modifying, and publishing applications.By building applications on the ServiceNow platform, you can take advantage of features and servicessuch assecurity, workflow, reporting, and notificationsand existing datasuch as users and locations. For example,manage conference room bookings.The app creator is available starting with the Calgary release.

    Custom Application DevelopmentFollow this basic process to use the app creator:1. Define the business requirements. Determine the problem you want to solve and how the application meets that

    need. Answer the questions: What does the application need to do? Who will use it? How will you know if it works?

    2. Define the data model. Identify general categories of information you need to track. What data is being captured? What tables are required and how will they reference each other? What changes do you anticipate later and does your data model scale to meet these changes?

    3. Create the application.1. Create an application record.2. Build the data model.3. Design the user interface, such as the list and form layout.4. Add business logic and automation, such as business rules, UI policies, notifications, and workflows, to meet

    your business requirements.4. Test the application. Locate the application in the navigator and make sure it works as you expect. Engage users

    early in your testing process. Document their feedback and make sure they are satisfied before moving to the nextstep.

    5. Publish the application. When it passes testing, publish the application. You can now transfer it to anotherinstance as an update set.

  • App Creator 2

    Example VideoThis video demonstrates how to create a visitor registration application. To see the example application, visit theServiceNow Demo [1].

    App Creator TablesThese tables provide the infrastructure for building and managing applications with the app creator. Application [sys_app]: contains the definition for each application. Application File [sys_app_file]: contains metadata for the records that define an application. Application File Types [sys_app_file_type]: defines which tables contain configuration records and the

    relationships between them.

    Application TableThe Applications [sys_app] table provides a framework for developing applications. Each record in the Applicationstable contains the definition for an application, similar to the system dictionary record for a table or column.Application developers build packaged solutions by associating configuration records, such as tables, roles, menus,or business rules, with an application record. Configuration records are associated with an application throughapplication files.See Creating a Custom Application.

    Application record

    Application File Table

    The Application File [sys_app_file]table contains a record for everyconfiguration record on an instance.Application file records store metadatafor configuration records, such asassigned application, parent record,and protection policySee Application Files.

  • App Creator 3

    Application file record

    Application File TypeTable

    The Application File Types[sys_app_file_type] table defineswhich tables contain configurationrecords and the parent-childrelationships between them. Forexample: A business rule has a parent table

    (the table it references). A UI policy action has a parent UI

    policy and a grandparent table.The system uses this structure to detect

    conflicts between applications under development. See Resolving Conflicts.

    This table provides system functionality and cannot be modified.

    Related TablesThese tables are also important to understand when building applications. Application Menus [sys_app_application]: groups modules under one name in the application navigator. See

    Administering Application Menus and Modules. Tables [sys_db_object]: contains a record for each table. See Table Administration. Dictionary Entries [sys_dictionary]: contains additional details for each table and the definition for every

    column on each table. Each row represents either a table or a column on a table. See System Dictionary. Field Labels [sys_documentation]: contains the human-readable labels and language information. See Field

    Labels.

    How the App Creator Works with Update SetsThe app creator and update sets both provide support for developing customizations, but in different ways. Eachconfiguration record, such as a business rule, has a single application file record, but it may have multiple updates.Applications group configuration records in their current state where update sets group configuration records at aspecific version. For example, compare the differences in this scenario.1. Select an update set and an application.2. Make a change to a tracked object, such as a business rule.3. Select a different update set and a different application.4. Make another change to the same business rule.

    Update sets: the same business rule is listed in both update sets, with a different version in each.Update sets track discrete changes to application files, and you can create one or more update sets to trackchanges for different tasks or multiple applications at once. For example, you can package small changes andfixes to several applications into one update set. You can also compare versions or revert to earlier versions ofa configuration record.

    Applications: the application file for the business rule is assigned to the original application only.

  • App Creator 4

    Application files are not moved automatically between applications, and an application file can only exist inone application at a time. You can manually move the application file, if necessary. You can publish anapplication to create an update set with only the most recent version.

    For custom application development, use the app creator to develop the application and update sets to deploy it.1. Create an application record. (App creator)2. Assign application files to it as you develop. (App creator)3. When development is complete, publish the current version of each record to an update set. (App creator to

    update sets)4. Transfer the application to another instance with the update set. (Update sets)

    ServiceNow ApplicationsServiceNow provides several standard and optional applications that are installed by plugins. An application recordexists for every active plugin on an instance (starting with the Dublin release). Every application file installed with a plugin is automatically assigned to the corresponding application. You cannot add application files to a ServiceNow application. ServiceNow applications are not available in the application picker or the Move to application dialog. Some ServiceNow applications are installed by plugins and system directories that do not appear on the list of

    plugins. For example, a plugin that is available only by request.To view a list of the trackable ServiceNow applications that are activated on the instance, navigate to SystemApplications > ServiceNow Applications. You can use the following fields to filter for ServiceNow applications.

    Field Description

    Vendor [Read-only] Lists the vendor that created the application. The value is ServiceNow if the application was installed by a plugin. The fieldis empty for custom applications.

    Code [Read-only] Stores the plugin ID for an application that was installed by a plugin. The field is empty for custom applications.

    Trackable Indicates whether a ServiceNow application is tracked for licensing and analytics. The Usage Analytics feature provides data collection,auditing, and reporting for trackable ServiceNow applications and all custom applications.

    In the Dublin release, the field label is Licensable.

    Note: These fields are not available on the application form or list by default. You can personalize the form or list layout to addthem, if desired.

    Menus and ModulesUse these modules to access common features for building and managing custom applications.

    Under the System Applications menu:

    Create Application: creates a new application record. See Creating Applications. Custom Applications: lists custom applications on the instance. ServiceNow Applications: lists the licensable ServiceNow applications that are activated on the

    instance (starting with the Dublin release). Application Files: lists all application files on the instance. Deleted Application Files: lists all application files for which the related record is deleted. Restore Application Files: lists the application files of deleted records that you can restore (starting

    with the Dublin release). See Restoring Deleted Records.

  • App Creator 5

    Under the System Definition menu:

    Application Menus: lists active menus on the instance (inactive menus are filtered by default). SeeAdministering Application Menus and Modules.

    Menu Categories: lists categories for defining the appearance of application menu labels. SeeModifying Menu Categories.

    Dictionary: lists dictionary entries for all tables and columns on the instance. See System Dictionary. Tables: lists all of the tables on the instance (text search index tables are filtered by default). See

    Creating Tables. Fix Scripts: lists code that you run after an application is installed or upgraded. See Fix Scripts.

    Enhancements

    Eureka Stores a user-defined version number for use when creating and publishing applications. For the Application table, changes the field label from Licensable to Trackable.

    Dublin An application record exists for every active plugin on an instance. Every application file record installed with a

    plugin is automatically assigned to the corresponding application. The app creator includes choice list options as part of an application through records in the Choice Set table,

    which have an associated application file. This feature allows you to add field choices to an application when thetable exists in another application (for example, choices for a field on the Incident table). See Customizing ChoiceLists.

    Administrators can now add homepages and content pages to an application. Administrators can restore deleted applications, tables, and fields along with all descendant records by clicking a

    related link on the deleted application file form. To ensure data integrity, deleting an application does not delete a table that is extended by a table in another

    application. The Restore Application Files module lists the application files of deleted records that you can restore. The Custom Applications module replaces the Applications module. On an application file record, the Related Record Versions and Related Record Updates related lists show the

    version and update records for the related configuration record. On an application file record, the Customer update and Replace on upgrade fields indicate whether the related

    record has customer changes and whether it will be upgraded to the next software version. When you pullversions from a parent instance, these fields are kept in sync to ensure that the same records are replaced duringsoftware upgrades of parent and child instances. See Team Development.

    References[1] http:/ / info. servicenow. com/ DemoNow

  • Creating a Custom Application 6

    Creating a Custom Application

    OverviewAdministrators can use the app creator to develop custom applications that meet business needs. After defining thebusiness requirements and the data model, create an application record and use it to help manage developmentactivities.After the application is developed and tested, you are ready to transfer it to another instance. See PublishingApplications.

    Creating Applications1. Navigate to System Applications > Create Application.2. Define the application by completing the fields on the form (see table).3. Click Submit. The application record remains open.

    The application record is saved and now appears on the Applications list. An application file record is created and assigned to the application. The application file appears in the All

    Files related list. The application is selected as the current application in the Application picker.

    Field Description

    Name Name that identifies the application record.

    Version String in dot-notation that identifies the application version. For example, 1.2.3. When you publish the application for transfer toanother instance, this field is passed to the update set. See Publishing Applications. This field is available starting with the Eurekarelease.

    Shortdescription

    An explanation of what this application does. When you publish the application for transfer to another instance, this field is thedefault description for the update set. See Publishing Applications.

    Active Indicator of whether the application is in use. The check box is selected by default, making the application active. Clear the checkbox to deactivate the application.

    Menu The primary menu, which is the default application menu for any modules created in this application (see Administering ApplicationMenus and Modules). This value is populated automatically based on the application name. You can edit the new menu name orselect an existing menu.

    Note:

    If the menu name does not match an existing menu, a new menu is created when you save changes to the application record. You can modify this field for an existing application to create a new menu or select another existing menu. The default user role

    is applied to the new menu. The original menu record is not changed.

    User role The default user role required for the primary menu and to access any tables created in this application (see Creating Security Rulesfor Tables). This value is populated automatically based on the application name. You can edit the new role name or select anexisting role.

    Note:

    If the user role does not match an existing role, a new role is created when you save changes to the application record. You can modify this field for an existing application to create a new role or select another existing role. The role is applied to the

    primary menu. The original role is not changed.

  • Creating a Custom Application 7

    Application record

    Defining Tables forApplications

    Build the data model you designed forthe application by creating customtables.1. Navigate to System Applications

    > Custom Applications.2. Open the application record.3. Scroll to the Tables related list.4. [Optional] Create a table by editing

    the list.When you create a table with thelist editor, a new list module isautomatically created for it. The

    module appears in the application navigator under the primary menu for the application. If the primary menu isnot defined, then a new menu is created with the table label as the name.

    5. Open a table record or click New to create a new table.6. Define the table and columns by completing the form. See Creating a Custom Table.

    Note: If you create a new table with the same name as a deleted table, the new table is associated with the application of the deletedtable instead of the current application. To avoid conflicts, use a unique name for each table. You can still use the same label.

    Activating and Deactivating ApplicationsTo activate an application:1. Navigate to System Applications > Custom Applications.2. Click All in the breadcrumbs to remove the default active = true filter condition and display both active and

    inactive applications.3. Open the application record.4. Select the Active check box and click Update.

    All associated menus, modules, and ACLs are set as active. You can selectively deactivate application menus, modules, and ACLs after you activate the application.

    To deactivate an application:1. Navigate to System Applications > Custom Applications.2. Open the application record.3. Clear the Active check box and click Update.

    All associated menus, modules, and ACLs are set as inactive. Users cannot access the application tables from the application navigator or by navigating directly to the table. You can create new menus, modules, and ACLs for this application, but you cannot set them as active.

  • Creating a Custom Application 8

    Working on ApplicationsSelect the current application to associate configuration records with it as you develop.1. Select the desired application in the Application picker. When you create a new application, it is automatically

    selected as the current application.

    Applications picker

    2. Create a new or make a change toan existing configuration record. For a new record, the application

    file is automatically assigned tothe selected application. If aconflict is detected, a notification

    appears. For an existing record, the application file is not assigned or moved to the selected application. If the record is

    not already associated with the selected application, a conflict notification appears.3. If a conflict notification appears, resolve the conflict.

    Resolving ConflictsA conflict may exist when application files that normally belong together are not assigned to the same application. Anotification appears when the application file you changed or its parent is not assigned to the application selected inthe Application picker. For example, a conflict is detected in this scenario. Table A is associated with Application A. Application B is selected in the Application picker. You create a new field on Table A.To resolve conflicts, choose an action for each conflict that is detected. To move the application files to the recommended application, click Move Files. To leave the application files where they are, click Leave Alone.

    Resolve each conflict

    Moving Application Filesto Applications Manually

    The most efficient way to buildapplications is to select an applicationin the Application picker so that newapplication files are automaticallyassigned to it and you are notified of

    potential conflicts. However, you can manually assign application files to applications by: Moving an application file with all of its descendant records (recommended). For example, when you move a UI

    policy, also move its UI policy actions. Similarly, when you move a table, also move all the fields and labels onthe table.

    Moving a single application file without affecting its descendants. Use this method with caution; if you move anapplication file without its descendants, items may be missing when you publish the application.

    Move files manually to assign unchanged application files to an application or to move application files from oneapplication to another.To move an application file with all of its descendant records (recommended):1. Navigate to the record in a list or form view (for example, System Definition > UI Policies).

  • Creating a Custom Application 9

    2. For a list, select the check box beside each appropriate row, and then select Move to Application in the Actionschoice list.

    3. For a form, right-click the header and select Move To Application.4. Select an application from the list. The list defaults to the last application you selected.

    Move application files to an application

    5. Click Add.The application file and all of itsdescendant records are moved tothe selected application.

    To move a single application filewithout affecting its descendants (usewith caution):1. Navigate to the record.2. Right-click the header and select

    Show Application File.3. In the Application field, select the

    desired application.

    4. Click Update.

    Update the application file record

    Adding Homepages andContent Pages toApplications

    Homepages and content pages are notadded automatically to update sets andapplications. To manually add a page:1. Navigate to Homepage Admin (or

    Content Management) > Pages.2. Right-click a homepage or content

    page record.3. Select Unload Portal Page.

    The page is added to the currentapplication (starting with the

    Dublin release) and to the current update set.

    Add the homepage or content page to thecurrent update set

    Creating Update Sets

    Use this shortcut to create an empty update set while you are workingon applications. You can use the update set to capture any changes; itis not specific to the application. To create an update set that containsthe current version of each record in the application, see PublishingApplications.

    1. Open the application record.2. Click the Create New Update Set related link.3. Enter a name for the update set.

  • Creating a Custom Application 10

    4. [Optional] Make this the current update set by selecting the check box.

    Create a new update set

    5. Click Create.

    Deleting ApplicationsBy default, deleting an application alsodeletes all the records that areassociated with the application, such astables, business rules, and menus.Alternatively, you can deactivate anapplication that is no longer in use.To delete an application:1. [Recommended] Back up the

    application in an update set. See Publishing Applications.2. Navigate to System Applications > Custom Applications.3. Open the application record.4. Click Delete. A confirmation dialog box indicates the number of application files in the application to be deleted.

    Confirm deletion

    5. [Optional] Click Show files tocancel deletion and navigate to a listof the application files in theapplication.

    6. [Optional] Clear the check box todelete only the application recordand not the rest of the records.

    7. Click OK.8. In the confirmation dialog, enter

    delete and click OK.

    The application record is deleted. If you selected the check box in step 6, all records associated with the application files are deleted. However, a

    table is not deleted if a table in another application extends it (starting with the Dublin release).

    Application is deleted

    To view a list of application filesfor deleted records, click theShow Deleted Files link. Youmay be able to restore some ofthe deleted records.

    To review the application file,click the Show Application Filelink (starting with the Dublinrelease). You may be able torestore the application andassociated records.

  • Creating a Custom Application 11

    Restoring Deleted RecordsIn some cases, you can restore deleted configuration records. Restoring deleted records changed starting with theDublin release. If you are using an older version, see previous version information.Limitations for restoring records include: You cannot restore a record if its parent record is deleted. For example, you cannot restore a field on a deleted

    table. You must restore the parent record first. You cannot restore a table if it extends a deleted table. When a record is deleted, the application file stores a reference to the current record version. You can only restore

    records when this reference and version record exist.To restore an application that you just deleted:1. On the deleted application confirmation page, click the Show Application File link.2. Under Related Links, click Restore Deleted Application.

    Restore all application records

    The application and all recordsthat were deleted with theapplication are restored.

    To restore an older application oranother configuration record:1. Navigate to System Applications

    > Restore Application Files.2. Locate the application file by

    filtering on the source table of theconfiguration record. For example: For an application, filter on

    Source Table is Applicationand look for the applicationname.

    For a table, filter on SourceTable is Table and look for thetable name.

    For a field, filter on Source Table is Dictionary Entry and look for the field name.3. Open the application file.4. Under Related Links, click the link to restore the record.

    The record is restored. If the record is an application, table, or field, all descendant records that were deleted with it are restored. For

    example, restoring an application also restores all records that were deleted with the application. Restoring atable also restores all the fields and labels that were deleted with the table.

    Restoring Deleted Records Prior to the Dublin Release

  • Creating a Custom Application 12

    Click the plus to expand previous version information

    In some cases, you can restore deleted configuration records. Limitations include:

    You cannot restore individual fields or field labels. You can only restore a deleted table, which restores any fields and labels that were deletedwith it.

    You can only restore records where both the update and version records exist. For example, you cannot restore a record if you also deleted theupdate record (see Deleting Update Entries).

    To restore an application that you just deleted:

    1. On the deleted application confirmation page, click the Show Deleted Files link.2. Select all of the rows.

    Restore all application records

    3. Select Restore Deleted Record in the action choice list.

    The application and all associated records are restored.

    To restore an older application:

    1. Navigate to System Applications > Deleted Application Files.2. Locate the application file by filtering on Source Table is Application and looking for the application name.3. Select the check box beside the application file.4. Select Restore Deleted Record in the action choice list.5. Filter the list of deleted application files again on Application is .6. Select all of the records.7. Select Restore Deleted Record in the action choice list.

    To restore a table:

    1. Navigate to System Applications > Deleted Application Files.2. Locate the table application file by filtering on Source Table is Table and looking for the table name.3. Select the check box beside the table application file.4. Select Restore Deleted Record in the action choice list.

    The table and all the fields and labels that were deleted with it are restored.

  • Creating a Custom Table 13

    Creating a Custom Table

    OverviewAdministrators can create custom tables as well as application menus, modules, and security rules that allow users towork with data in the tables. Administrators can also create service catalog record producers directly from a tablerecord. Creating tables is a core part of creating an application (see Creating a Custom Application).

    Creating Tables1. Navigate to System Definition > Tables.2. Click New.3. Define the table by completing the fields on the form (see table).4. Use the Table Columns embedded list to add columns to the table.5. Click Submit to create the table, or click Cancel to close the Table form without creating a new table.

    Field Description

    Label Enter a unique label for the table. The label appears on list and form views for the table. Updating the Label field also updatesthe label record in the language file (for the current language). See Field Labels.

    Name [Optional] Edit the table name, which is automatically populated based on the table label. You can use lowercase, alphanumericASCII characters and underscores (_) in the table name. The table name is prefixed with u_ to indicate that it is a custom table.You cannot modify this prefix.

    For example, if you enter Marketing Event as the table label, the table name defaults to u_marketing_event.

    Extensible Select the check box to allow other tables to extend this table. Clear the check box to prevent the creation of additional childtables; existing child tables remain unchanged.

    Extends Table [Optional] Select the table to extend. Extending a base table incorporates all of the fields of the original table and creates newfields for the new table. Only tables that are marked as extensible appear in this list.

    This option is available only when you are creating a table.

    Create module [Optional] Select the check box and then complete the Add module to menu field to create a list module in the applicationmenu.

    This option is available only when you are creating a table.

    Add module tomenu

    Select an existing menu or select Create new and enter a new menu name. This option is available only when the Createmodule check box is selected.

    Create accesscontrols

    [Optional] Select the check box and then complete the User role field to create basic security rules for the table.

    User role Enter a new name or select an existing user role that is required to access this table. This option is available only when theCreate access controls check box is selected.

    Live feed [Optional] Select the check box to enable document feeds for the table (starting with the Dublin release). This option adds theShow Live Feed button ( ) in the form header.

    Auto-number [Optional] Select the check box, and then define the number format to add an auto-numbered field to the table. The check box isavailable only when a number format does not exist for the table. Otherwise, you can edit the existing number format.

  • Creating a Custom Table 14

    Requests table

    Adding ColumnsYou can add database columns (fields)when creating a new table or whenediting an existing table. To learn moreabout creating fields, see Creating NewFields.

    To add columns from the table record:1. Navigate to System Definition >

    Tables.2. Create a new table or open an

    existing table record.3. In the Table Columns embedded

    list, double-click Insert a new row.4. Define the column by completing the fields in the row (see table).

    [Existing tables only] You can create a column with advanced settings by right-clicking the form header andselecting Create Advanced Column. See Modifying Dictionary Entries.

    The Table Columns embedded list provides list filtering, searching, and sorting in addition to standardembedded list functions.

    5. Repeat steps 34 for each column being added. To delete a field, click the red X beside the row. This option is available only for custom fields. To save column changes, save the form. See Using Embedded Lists.

    6. Click Submit or Update.7. [Optional] To customize the form layout for the new fields, open the table record, click the Personalize Form

    related link, and then personalize the form.New fields are automatically added to the default form view. If a default form view already exists, new fieldsare added at the end of the first section.In versions prior to the Dublin release, open the table record, click the Show New Record Form related link,and personalize the form.

    8. [Optional] To customize the list layout for the new fields, open the table record, click the Personalize Listrelated link, and then personalize the list.

    In versions prior to the Dublin release, open the table record, click the Show Records in List related link, andpersonalize the list layout.

  • Creating a Custom Table 15

    Field Description

    Columnlabel

    Defines a unique label for the column. The label appears on list headers and form fields for the column.

    Updating the Column label field also updates the label in the language file (for the current language). See Field Labels. When you create a new column, the column name is populated automatically based on the label. The name is automatically

    prefixed with u_ to indicate that it is custom. For example, if you enter Activity Description as the column label, the column namedefaults to u_activity_description.

    Type [Mandatory] Defines the field type for the column. See Introduction to Fields. To preserve existing data, only change fields betweenthe same basic type (for example, Choice and String). A warning appears if a change to a custom field will result in data loss. For abase system field, you cannot make a change that will result in data loss.

    Reference Makes the field into a reference field.

    Note: Dynamic reference creation is enabled for this field. So, if you enter a table name that does not match an existing table, a newtable is created when you save your changes to the current table record. If the current table has a module in the application navigator,then a module for the newly created table is automatically created in the same application menu.

    Maxlength

    [String fields only] Limits the length of the field. A length of under 254 appears as a single-line text field. Anything 255 characters orover appears as a multi-line text box.

    Note:

    You can change this value only for a String field. Changes for any other type of field are ignored. Users on an Oracle instance cannot increase the maximum length of a string field to anything greater than 4000 through the

    application UI as this requires the CLOB datatype in Oracle. To increase beyond this size, log an incident with Technical Supportto request the change.

    To prevent data from being lost, only decrease the length of a string field when you are developing a new application and not whena field contains data. A warning appears if a change to a custom field will result in data loss. For a base system field, you cannotmake a change that will result in data loss.

    Defaultvalue

    Specifies the default value of the field for any new record. Ensure that this value uses the correct field type. For example, an integerfield can use a default value of 2 but cannot use a default value of two. These values can be overridden with dictionary overrides.

    Display Indicates that this field is the display value for reference fields (appears on records that reference this table).

    Note: This option does not control whether or not this field is displayed on lists or forms.

    Global Default FieldsWhen you create a new custom table, several fields appear in the Table Columns embedded list. For all tables,required system fields are added automatically. You cannot delete or modify these fields.For tables that extend another table, fields on the parent table also appear on the Table Columns embedded list forthe current table. If you modify these fields, remember that all changes to fields on the parent table also affect allchild tables, not just the current table.These required system fields are added to all tables:

    Field Type Description

    Class [sys_class_name] System Class Name If the table is extensible, a string field that indicates which child table contains the record.

    Created [sys_created_on] Date/Time A time-stamp field that indicates when a record was created.

    Created by [sys_created_by] String A string field that indicates the user who created the record.

    Sys_id [sys_id] Sys ID The unique record identifier for the record.

    Updates [sys_mod_count] Integer A numeric field that counts the number of updates for this record since record creation.

    Updated by [sys_updated_by] String A string field that indicates the user who most recently updated the record.

    Updated [sys_updated] Date/Time A time-stamp field that indicates the date and time of the most recent update.

  • Creating a Custom Table 16

    Creating Modules for TablesModules allow users to access the table from the application navigator. To learn more about modules, see CreatingModules. To learn about mobile device modules for instances that use the smartphone interface, see DefiningSmartphone Application Menus and Modules.When you are creating a table, you can quickly create a default module for the standard browser and the mobile UI.1. Select the Create module check box. The Add module to menu field appears.2. Select an existing menu or select Create new and enter a new menu name.

    If you are working on an application, the primary menu is selected by default. If you are not working on an application, Create new is selected and the menu name defaults to the table label.

    3. Define the table and save the record. A new module is created with the following values:

    Table: current table Title: plural of the table label Link type: List of Records Application menu: selected menu Device type: Any (starting with the Dublin release for instances that do not use the smartphone interface)

    If you selected Create new in step 2, a new application menu is created. The Default device type is set to Any(starting with the Dublin release for instances that do not use the smartphone interface).

    For instances that use the smartphone interface, a new mobile module and a new mobile application menu arecreated.

    Create a default module

    To create additional modules (forexample, a filtered list view):1. Navigate to System Definition >

    Tables and open the Table form.2. Scroll down to the Modules related

    list, and click New.3. Define the module by completing

    the Module form. See Creating aModule.

    The Table field defaults to thecurrent table and the Link type defaults to List of Records.

    The Device type field defaults to Any (starting with the Dublin release for instances that do not use thesmartphone interface).

    You must enter the Application menu and Title.To create additional modules for the mobile UI (for instances that use the smartphone interface only):1. Navigate to System Definition > Tables and open the Table form.2. Scroll down to the Mobile Modules related list, and click New.3. Define the module by completing the Module form. See Defining Smartphone Application Menus and Modules.

    The Table field defaults to the current table. You must enter the Application menu and other module information.

  • Creating a Custom Table 17

    Adding Record NumberingYou can quickly create a number field and define the number format for records on the table. To learn aboutadditional numbering options, see Managing Record Numbering.To add record numbering to a table that does not have a number format defined:1. Navigate to System Definition > Tables.2. Create a new table or open an existing table record.3. Select the Auto-number check box. The number format fields appear on the form.

    Note: The check box is available only when a number format has not yet been defined. You can define onlyone number format per table.

    Add record numbering

    4. [Optional] Modify the numberformat by updating the fields (seetable).

    5. Click Submit. The number format is

    automatically created for thetable.

    If an auto-numbered field doesnot already exist, a new field is automatically created on the table with the following values: Label: Number Name: u_number Default value: javascript:getNextObjNumberPadded();

    Field Description

    Prefix Enter a prefix for every number in the table (for example, INC for Incident). The default value is the first three letters of the tablelabel.

    Number Enter the base number for this table (default value is 1000). Record numbers are automatically incremented, and the next number ismaintained in the Counter [sys_number_counter] table.

    If you set the base number to a value higher than the current counter, the next record number uses the new base number. Otherwisethe next record number uses the current counter. The counter does not reset to a base number lower than itself.

    Number ofdigits

    Enter the minimum number of digits to use after the prefix (default value is 7).

    Leading zeros are added to auto-numbers, if necessary. For example, INC0001001 contains three leading zeros. The number of digits can exceed the minimum length. For example, if Number of digits is 2 and more than 99 records are

    created on the table, the numbers continue past 100 (such as INC101).

    Warning: Changing this field may update all number values for existing records on a table. Take care when changing this field on aproduction instance. See Renumbering Records.

    Note: To change the default values for new number formats, change the Default value field on the system dictionary record for theNumber or Number of digits field. These fields are on the Number table.

  • Creating a Custom Table 18

    Removing Record NumberingTo remove record numbering from a table, delete the number format and the auto-numbered field.1. Navigate to System Definition > Number Maintenance.2. Click a table name to open the number record for that table.3. Click Delete.4. Navigate to System Definition > Tables and open the Table form.5. Click the red X beside the auto-numbered field.6. Click Update.

    Creating Security Rules for TablesYou can quickly create basic security rules for a table. To learn more about security rules, see Using Access ControlRules.To create security rules from the table record:1. Navigate to System Definition > Tables.2. Create a new table or open an existing table record.3. Select the Create access controls check box. The User role field appears on the form.4. Enter a new name or select an existing user role that is required to access the table.

    If you are working on an application or a table that is part of an application, the default user role for theapplication is automatically populated. Otherwise, the field is automatically populated based on the table label.

    Add table security

    5. Click Submit or Update. If the user role does not match an

    existing role, a new role iscreated.

    Security rules are created thatgrant the user role full access tothe tableread, write, create,and delete.

    6. [Optional] Scroll down to the Access Controls related list to create new or modify existing access control list(ACL) rules.

    Note: You can repeat the procedure to grant full access to a different role. The new role is created and the original role is replacedfor every ACL on the table. The original role is not changed for ACLs on other tables or objects, and any other roles or scripts on theACLs are not changed.

    Extending a TableYou can create a new table that stands alone or that extends a base table. Extending a base table incorporates all ofthe fields of the original table and creates new fields for the new table. This inheritance is used to createsubcategories of data. Examples include the Incident, Problem, and Change tables, which are all subcategories of theTask table.To extend a table, select the table to extend in the Extends Table field on the table record. This option is availableonly when you are creating a table.

  • Creating a Custom Table 19

    Note: For a table that extends another table, the Table Columns embedded list shows columns on both the child table and the table itextends. To improve sorting and filtering, consider personalizing the list to add the Table field. You cannot change the table for afield. You can add columns only to the current table.

    Personalize Table Columns list to sort fields by Incident or Task

    To make a table extensible:1. Navigate to System Definition >

    Tables.2. Click the table that you want to

    extend.3. Select the Extensible check box.

    The table is now available in theExtends Table field.

    Note: You cannot extend system tables (such as sys_audit) or database view tables.

    Example: Enabling Workflows for Tables that Extend TaskTo create a table of task records, similar to the Incident, Problem, or Change table, create a new table that extendsthe Task table. To allow workflows to operate on the table:1. Navigate to System Definition > Tables and open the new table record.2. Right-click the form header and select Show Dictionary Record.

    In versions prior to the Dublin release, click the Show Dictionary Record related link.3. Add the following to the attribute:

    hasWorkflow

    The new table now has fields from the Task table and supports workflows.

    Example: Creating a New CMDB ClassEach CMDB class is its own table, so creating new classes requires creating new tables.To create a new class (such as Laptops or Thin Clients):1. Create a new table (see following table for specific values).2. [Optional] If you want other CMDB classes to extend the new one, select the Extensible check box. You can also

    select this field after the table is created.3. Use the Table Columns embedded list to add any class-specific columns. For example, the following image

    shows a way to create a new CMDB class for laptops.

  • Creating a Custom Table 20

    Example: CMDB class for laptops

    4. Click Submit.5. Add any related lists. Refer to the

    existing classes (such asWorkstations) for examples.

    6. Position the new module in thecorrect location in the applicationnavigator.

    In the Laptops example, thenew class belongs next to theWorkstations module, under theBase Items heading.

    1. Right-click Configuration inthe application navigator and select Edit Application.

    2. Locate the Workstations module in the list and note the value in the Order column.3. Open the new Laptops module and give it an order value one number greater or less than the order number

    of the Workstations module.4. Click Update.

    Field Description

    Label Enter the name of the new class (such as Laptops or Thin Clients).

    Name Preface the name of the table with u_cmdb_ci_ to make it similar to the other CMDB classes (for example, u_cmdb_ci_laptop).

    Extensible Select the check box to allow other tables to extend this table.

    Extends Table Select the parent table for the new class. For example, if the new class is Laptops, which is a subclass of Computers, select thecmdb_ci_computer table. If the new class is a top-level class, select the cmdb_ci table.

    Add module tomenu

    Select the check box and then select the Configuration application to create a list module for the new class in the sameapplication with the other classes.

    Creating Record Producers for TablesTo save time, you can create service catalog record producers directly from a table record (starting with the Dublinrelease). In versions prior to Dublin, you can only create record producers in the service catalog.To create a record producer from a table record:1. Navigate to System Definition > Tables and open the table record.2. Under Related Links, click Add to Service Catalog.3. Complete the Name, Short Description, and Category fields as you would for service catalog items.4. Use the slushbucket to select the fields and the order in which you want them to appear. To use container

    variables, select |- container start -| and |- container start -|.

  • Creating a Custom Table 21

    Record producer

    5. Click Save and Open to open therecord producer and defineadditional options. Alternatively,click Save to return to the tablerecord.

    A record producer is createdwith these values: Table name: table record

    opened in step 1 Name, Short Description,

    and Category: informationentered in step 3

    A variable is created for each ofthe selected fields with thesevalues: Name: Column name of the

    field Type: variable type that corresponds to the field type Order: position selected in the slushbucket (for example, 100 for the first field and 200 for the second

    field) Question: Column label of the field

    If the field type is Choice, a corresponding question choice is created for each field choice. The new record producer is added to the Record Producers related list on the table record.

  • Application Files 22

    Application Files

    OverviewApplication files associate configuration records with an application and contain metadata for the records.Administrators use application file records to: See application-related attributes. See parent-child relationships between configuration records. Assign records to an application. See Moving Application Files to Applications Manually. Restore deleted configuration records. See Restoring Deleted Records.This feature is available with the Calgary release.

    Application File RecordsFor every configuration record, the Application File [sys_app_file] table contains a record that defines applicationattributes (see table). The Application File Types [sys_app_file_type] table defines which tables containconfiguration records (such as tables, business rules, client scripts, or UI pages).Configuration records are also tracked by update sets, which allow you to transfer the application to another instance.When an application file record or its related record is changed, a corresponding record is added in the CustomerUpdates [sys_update_xml] table. The application file record is tracked and transferred along with the customizedrecord in a single update record, ensuring that a record and its application file are kept in sync when transferringapplications between instances.Application files are not created explicitly. Whenever a configuration record is created or modified, its associatedapplication file is automatically created or modified. An application file is programmatically kept in sync with therecord it describes, and most configuration tables do not have a direct reference to the application file table. Bydefault, only Applications [sys_app] and Tables [sys_db_object] have an explicit reference field to the ApplicationFile [sys_app_file] table.

    Field Description

    Name Display name for the related configuration record.

    Related record Reference to the configuration record.

    Parent file Reference to the parent application file, if one exists.

    Application Application that contains the application file.

    Protectionpolicy

    Policy preventing customization of certain base system code.

    Created Creation date of the related record.

    Created by User who created the related record.

    Additional fields on the list view:

    Source Table Table containing the related record.

    Updated Last update date for the application file or related record.

    Updated by User who last updated the application file or related record.

    Fields that can be added by personalizing the form:

  • Application Files 23

    Replace onupgrade

    Flag that indicates whether the related record will be upgraded to the next software version (starting with the Dublin release). Thevalue is automatically set to false when you change non-excluded fields on the related record. To overwrite changes during thenext software upgrade, change the value to true. See Overwriting Customizations During Upgrades.

    Customerupdate

    Flag that indicates whether the related record has customer changes (starting with the Dublin release). The value is automaticallyset to true when you change any field on the related record.

    Related lists on the form view:

    Related RecordVersions

    Version records for the related configuration record (starting with the Dublin release). A version record is every time a userchanges the related record. Use this list to compare versions of the configuration record or to revert to a previous version. SeeVersions.

    Related RecordUpdates

    Local update records for the related configuration record (starting with the Dublin release). An update record is created for themost recent change to the related record in a given update set. See Update Sets.

    ApplicationsAn application file associates its related configuration record with an application record. Assign application files toan application to: Understand who owns and who changes application records and code. Detect conflicts between applications under development. Publish the current version of each application file to an update set when development is complete.See Working on Applications.

    Protected Application FilesSome application code shipped with ServiceNow requires special protection. When an application file has aRead-only protection policy, nobody can modify the related record. Only a ServiceNow employee can alter theprotection policy and then modify the application file or its related record. A ServiceNow employee cannot makeany changes without changing the policy designation first.To prevent customizations from being overwritten by system upgrades, the upgrade process automatically skipschanges to customer-updated records. If you modify an application file or related record that is later designated asRead-only in an upgrade, the application file maintains the default protection policy of Write. You keep the existingmodifications and can continue modifying the records.

    Relationships Between Application FilesIn addition to defining which tables contain configuration records, the Application File Types table also definesparent-child relationships between configuration records. The system uses this structure to keep application files thatnormally belong together in the same application by: Notifying developers when a conflict is detected between applications under development. See Resolving

    Conflicts. Moving an application file with its descendants. See Moving Application Files to Applications Manually.

    Warning: The Application File Types table provides system functionality and should not be modified.

    For example, consider the parent-child relationships for a UI policy. The UI policy is a child of the table.

  • Application Files 24

    UI policy actions are children of the UI policy. UI policy actions have a parent UI policy and a grandparent table. The UI policy actions and the UI policy are all descendants of the table.

    UI Policy relationships

    From an application file record, youcan access related application files. Tonavigate from an application file to itsparent, click the Show Parent Filerelated link.

    Show Parent File

    To see all child application files for anapplication file, scroll down to theDescendant Files related list.

    Descendant Files

    NavigatingApplication Files andRecordsNavigate between a configurationrecord and its application file byright-clicking the form header andselecting Show Application File.

  • Application Files 25

    Show Application File

    Navigate between an application fileand its related record (for example, anapplication menu record) by clickingthe Show Related Record related link.

    Show Related Record

    You can also navigate between acustomer update record and theapplication file or the related record.See Navigating Updated Records.

    NavigatingApplication File ListsNavigating from a list of applicationfiles to a record works differently from

    most lists. To open the application file record itself, click the reference icon beside the row. To open the related record, click the link in the first column.

    Application files list

    For example, use any of theseapplication file lists to help build andmanage applications: Navigate to System Definition >

    Application Files to see a list of allapplication files on the instance.

    Example use: filter allapplication files by application,

    type of record (source table), user who created it, or when it was last updated. Navigate to System Definition > Deleted Application Files to see a list of all application files for which the

    related record is deleted.Example use: restore an application or table. See Restoring Deleted Records.

    Open an application record and scroll down to the All Files related list to see a list of all application filescontained in the application.

    Example use: run fix scripts after you transfer an application to another instance. See Running Fix Scripts.

  • Fix Scripts 26

    Fix Scripts

    OverviewA fix script is server-side JavaScript code that you run after an application is installed or upgraded. Include fixscripts to make changes that are necessary for the data integrity or product stability of an application.Administrators and users with the script_fix_admin role can create and run fix scripts. This feature is available withthe Calgary release.

    Creating Fix ScriptsTo create a fix script:1. Navigate to System Definition > Fix Scripts.2. Click New.3. Define the fix script by completing the fields on the form (see table).

    Fix script

    4. Click Submit.5. Test the fix script and make any

    necessary changes.

    Field Description

    Name Enter a unique, descriptive name for the fix script.

    Active Select the check box to enable the fix script.

    Unloadable Select the check box to create Customer Update [sys_update_xml] records when the fix script runs. Clear the check box to runupgrades without creating these records (default).

    Unloadable is enforced when you test the fix script.

    Run once Select the check box to run the script only one time (default). The fix script is ignored for subsequent upgrades.

    Clear the check box allow the script to run every time the application is installed or upgraded.

    This option is enforced by the following mechanism.

    When a fix script is processed, a corresponding record is added to the sys_update table. The upgrade process automatically skips fix scripts that are flagged as Run once and have an entry in the sys_update table.

    Run once is not enforced when you test the fix script.

  • Fix Scripts 27

    Flushcache

    Select the check box to require a cache flush after the application is installed or upgraded. Certain system changessuch as changesto the dictionary, client scripts, UI policy, or system propertiesrequire a cache flush to take effect.If the check box is selected for at least one of the fix scripts that are run, the cache is flushed when the installation or upgrade iscomplete. If the check box is not selected for any of the fix scripts that are run, then the cache is not flushed.

    Flush cache is enforced when you test the fix script.

    Before Select the check box to run the fix script before installing or upgrading the application. Clear the check box to run the fix script after(default).

    Description Enter a description of the fix script.

    Script Enter the code for the fix script.

    Testing Fix Scripts

    Warning: Do not test fix scripts on production instances. Fix scripts can add, update, and delete data, including rules, scripts,and property settings.

    1. Open the fix script record.2. Review the code design to ensure that it can run more than once on the same system without causing damage.

    Note: This review is different from the Run once option, which determines whether it is necessary to run itmore than once on the system. For example, you may write a fix script that adds a role to a property by default.Design the script so that it can run multiple times on the same system without overwriting the existing data,even if it is not necessary to run the script again after the initial installation.

    3. Click the Run Fix Script related link.Note: The Run once option is not enforced for tests. The Flush cache and Unloadable options are enforced.

    4. Confirm how to run the script. Click Proceed in Background to run the script in the background. Use this option for long-running scripts or

    if you do not know the expected execution time. Click Proceed to run the script in the foreground. The results are displayed in a confirmation window when the

    execution is completed.

    Successful fix script test

    5. Review the results and make anynecessary changes. Click Show Progress Workers to

    view a list of previous test results. You can cancel a job that is currently

    running by opening the progressworker record and clicking the Canceljob related link.

  • Fix Scripts 28

    Previous test results

    Running Fix ScriptsAfter you transfer an application toanother instance (see PublishingApplications), you must manually runany necessary fix scripts.

    1. Navigate to System Applications> Custom Applications.

    2. Open the application record.3. Scroll down to the All Files related list.4. Filter the list for fix scripts (Source Table is Fix Script).

    Fix scripts included in an application

    5. Run each fix script and ensure thatit completes successfully.

  • Publishing Applications 29

    Publishing Applications

    OverviewAdministrators can publish applications that are complete and ready to transfer to another instance. For example,publish an application to transfer and deploy it to a production system.This feature is available with the Calgary release.

    Publishing Applications1. Navigate to System Applications > Custom Applications.2. Open the application record.3. Click the Publish to Update Set related link.4. [Optional] Define additional application information by completing the fields in the dialog box (see table).

    Publish Application dialog box

    5. Click Publish.A new update set is created andthe latest update of eachapplication file in the applicationis copied into it. The update setis marked as complete.

    6. Transfer the update set to anotherinstance according to your testprocess. See Transferring UpdateSets.

    7. Run any fix scripts that are included in the application.

    Field Description

    Applicationname

    [Read-only] Displays the name of the application that you are publishing.

    Version Enter version information to append to the update set name in dot-notation such as 1.2.3. The platform saves the information youenter here in the application Version field (starting with the Eureka release).

    The update set has the name - . If you leave this field blank, the initial update set has the name and subsequent update sets have the name - .

    Description Enter a description for the update set. By default, this field contains the short description of the application.

    Include data Select the check box to include a limited number of data records from each table in the application. Use this feature to packagesample data with your applications.

    Warning: Using this feature to migrate large quantities of data records between instances can cause performance issues, as it is notintended for this purpose. To migrate data, use an instance-to-instance import. Administrators can adjust the maximum number ofdata records to include with an application.

    Note:

    If your sample data includes tables with record numbering, the current counter value is also transferred. When the update set isapplied on another instance, the counter is set to the larger of the counter in the sample data or the counter on the target instance.

    For translated fields, only records in English are transferred.

  • Publishing Applications 30

    Setting Limits for Publishing DataAdministrators can limit the number of data records to include when publishing an application.1. Enter sys_properties.list in the navigation filter.2. Locate the com.snc.apps.publish.maxrows property.3. Set the Value field.

    To minimize performance impact, set this value to less than or equal to the default value of 1,000.4. Click Update.

  • 31

    Examples

    Conference Room Bookings

    OverviewThis example guides you through creating a simple custom application for managing conference room requests. Tolearn more about the features demonstrated in this example, see Further Reading.

    AudienceThis guide is intended for junior ServiceNow system administrators. You should be familiar with the platform, butyou don't need much experience developing or maintaining custom tables. A basic understanding of JavaScript andrelational databases would be helpful, but is not necessary.

    Create an Application Record1. Navigate to System Applications > Create Application.2. Define the application by completing the following fields on the form. Use the default values for the rest of the

    fields. Name: Conference room bookings Short description: Book conference rooms

    3. Click Submit. The application record remains open. The application record is created and appears on the Applications list. An application menu, called Conference room bookings, is created. A user role, u_conference_room_bookings_user, is created and granted access to the Conference room

    bookings application menu. File records for the application, menu, and role are automatically created and assigned to the application

    (appear in the All Files related list). The Conference room bookings application is selected as the current application in the Application picker.

  • Conference Room Bookings 32

    Application record

    Build the Data Model

    Request Table

    1. On the application record, scrolldown to the Tables related list.

    2. Click New.3. Define the table by completing the

    following fields on the form. Usethe default values for the rest of thefields. Name: Request Auto-number: Select the check

    box and use the default valuesfor the number format.

    4. In the Table Columns embedded list, define each column (see table).5. Click Submit.

    The Request table is created with the columns you defined, an auto-numbered field, and the required systemfields.

    Security rules are created to grant the u_conference_room_bookings_user role full access to the Request table. The Room table is created with the required system fields. A user role, u_room_user, is created. Security rules are created to grant the role full access to the Room table. Modules for the Request and Room tables are created under the Conference room bookings application

    menu. Application file records for the tables, columns, modules, security rules, and roles are automatically assigned

    to the application.

    Column label Type

    Requester Reference to User

    Date and time Date/Time

    Location Reference to Room (a table that does not yet exist)

    Attendees Integer

    Duration Integer

  • Conference Room Bookings 33

    Request table

    Room Table

    1. On the application record, scrolldown to the Tables related list.

    2. Open the Room table record.3. Select the Auto-number check

    box. Use the default values for thenumber format.

    4. In the Table Columns embeddedlist, define each column (see table).

    5. Click Update. The new columns you defined

    and an auto-numbered field arecreated.

    The Name field is set as the display column, meaning that it appears on records that reference the Room table. The application file records for the columns are assigned to the application.

    Column label Type

    Name String. Set Display to true

    Campus Choice

    Capacity Integer

    Floor Integer

    Phone number String

    Polycom True/False

    Projector True/False

    WiFi True/False

  • Conference Room Bookings 34

    Room table

    Campus Choices

    Create a choice list of campuses:1. Open the Room table record.2. Under Related Links, click Show

    Form.

    In versions prior to the Dublinrelease, click Show New RecordForm.

    3. Right-click the Campus field labeland select Personalize Choices.

    4. Create the following options: San Diego Seattle Austin Chicago Detroit Amsterdam London

    Tokyo5. Click Save.

    Campus choice list

    Room Data

    Enter data for available conferencerooms:1. Navigate to Conference room

    bookings > Rooms.2. Click New.3. Enter the room details as listed in

    the table.4. Click Submit.5. Repeat steps 1 4 for all rooms in

    the table.

  • Conference Room Bookings 35

    Name Campus Capacity Floor Phone number Polycom Projector WiFi

    Aruba San Diego 7 3 (858) 430-9812 true true false

    Fiji Austin 9 19 (512) 398-4531 true true true

    Jamaica Amsterdam 27 9 +20 043-9086 true true true

    Oahu Detroit 17 2 (313) 490-2346 true true true

    Tahiti Tokyo 5 7 +31 098-04356 false true true

    Security1. In the banner, click the lock icon beside your user name and select the security_admin check box to elevate your

    role. Click OK.

    Elevate your role

    2. Navigate to Conference room bookings> Rooms.

    3. Right-click the list header and selectPersonalize > Table to open the tablerecord.

    4. In the Access Controls related list, openthe record for the read operation.

    Read operation ACL

    5. In the Requires role related list,click Edit.

    6. Add theu_conference_room_bookings_userrole and click Save.

    7. Navigate to User Administration> Roles.

    8. Open the u_room_user record.9. In the Contains Roles related list,

    click Edit.10. Add the

    u_conference_room_bookings_user role and click Save.

  • Conference Room Bookings 36

    Design the User Interface

    List and Form LayoutChange the default list and form layout for the Request table.1. In the banner, click the icon beside the Application picker to open the current application record.

    Show selected application

    2. In the Tables related list, open theRequest table record.

    3. Under Related Links, clickPersonalize List.

    In versions prior to the Dublinrelease, click Show Records inList. Then, right-click the headerand select Personalize > ListLayout.

    4. Use the slushbucket to select the columns and the order in which you want them to appear.You can match this sample list layout.

    Requests list layout

    5. Click Save.6. Under Related Links, click

    Personalize Form.

    In versions prior to the Dublinrelease, on the Requests list,click New. Then, right-click the

    form header and select Personalize > Form Layout.7. Use the slushbucket to select the fields and the order in which you want them to appear.

    You can match this sample form layout.

    Request form layout

    8. Click Save.

    Field Label

    Change the field label for meetingduration:1. Navigate to Conference room

    bookings > Book a conference room.2. Click New.3. Right-click the Duration field label and select Personalize Label.4. In the Label field, enter Duration (minutes).5. Click Update.

  • Conference Room Bookings 37

    ModuleChange the title and icon for the automatically created Requests module:1. Navigate to Conference room bookings.2. Right-click the icon beside Requests and select Edit Module.3. Change the title to Book a conference room.4. Change the image to select another icon.

    Request module

    5. Click Update.

    Add Business Logicand Automation

    Populate the RequesterAutomatically populate the Requester field with the current user:1. Navigate to Conference room bookings > Book a conference room.2. Click New.3. Right-click the Requester field label and select Personalize Dictionary.4. In the Default Value field, enter this code:

    javascript:gs.getUserID()

    5. Click Update.

    Identify a RoomHelp users identify a suitable room based on attendance and campus location:1. Navigate to Conference room bookings > Book a conference room.2. Click New.3. Right-click the Location field label and select Personalize Dictionary.4. In the Reference qual field, enter this code:

    javascript:'u_capacity>=' + current.u_attendees

    5. In the Attributes field, enter:ref_auto_completer=AJAXTableCompleter,ref_ac_columns=u_campus;u_capacity

  • Conference Room Bookings 38

    Dictionary Entry for Location

    6. Click Update.7. Click the reference lookup icon (

    ) beside the Location field.8. In the lookup window, right-click

    the list header and selectPersonalize > List Layout.

    Personalize the reference lookup list

    9. Add the Campus and Capacityfields and click Save.

    Send an EmailConfirmation

    Email the requester to confirmacceptance of the request:1. Ensure that the instance is

    configured to send email. SeeConfiguring Email.

    2. Navigate to System Policy >Email > Notifications.

    3. Click New.4. Define the email notification by completing the fields on the form (see table). Use the default values for the rest

    of the fields.

    Email notification

    5. Click Submit.6. Navigate to System Definition >

    Tables.7. Open the Request [u_request] table

    record.8. For the Number column, set the

    Display value to true.9. Click Update.

  • Conference Room Bookings 39

    Field Value

    Name Conference room bookings

    Table Request [u_request]

    When to send

    Send when Record inserted or updated

    Inserted Select the check box

    Updated Select the check box

    Conditions Location is not empty

    Who will receive

    Users/groups in fields Requester

    What it will contain

    Subject Approved - conference room request #${u_number}

    Message Your conference room request is approved.

    Request #: ${URI_REF}

    Room name: ${u_location.URI_REF}

    Date and time: ${u_date_and_time} for ${u_duration} minutes

    Campus: ${u_location.u_campus}, Floor ${u_location.u_floor}

    Call-in number: ${u_location.u_phone_number}

    Test the Application1. Navigate to User Administration > Users and open a test user record.2. Ensure the user has a valid email address.3. Grant the u_conference_room_bookings_user role to the user.4. Impersonate or log in as the user.5. Navigate to Conference room bookings > Book a conference room.6. Click New.

    Notice that the Requester field is automatically populated with the user name.7. In the Attendees field, enter 9.8. Click the icon beside the Location field.

    Notice that the list only shows rooms with a capacity greater than or equal to 9.9. Close the window. In the Location field, begin typing J.

    Notice that the auto-complete shows the name, campus, and capacity for matching rooms.10. Select Jamaica.11. Complete the rest of the form and click Update.12. Run through several more scenarios to test the business logic and functionality.13. Log back in as an administrator.14. Navigate to System Mailboxes > Outbound > Sent. If the emails are not listed, remove the Mailbox = Sent

    condition from the breadcrumbs.15. Open an email record.16. Under Related Links, click Preview HTML body.

    Notice that email notifications were generated with the correct information.

  • Conference Room Bookings 40

    Publish the Application1. Navigate to System Applications > Applications.2. Open the application record.3. Under Related Links, click Publish to Update Set.4. Click Publish.5. On the confirmation screen, click Update Set to view the update set that you can use to transfer the application to

    another instance.

    Further ReadingThese articles contain details about the features demonstrated in this example.

    Section Suggested Wiki Links

    Create an Application Record App Creator Creating a Custom Application

    Build the Data Model Creating a Custom Table Customizing Choice Lists Using Access Control Rules Creating Roles

    Design the User Interface Personalizing Lists Personalizing Forms Introduction to Fields Administering Application Menus and Modules Module Icons

    Add Business Logic and Automation Reference Fields Auto-Complete for Reference Fields Reference Qualifiers Email Notifications

    Test the Application Creating Users and Associating to a Group Impersonating a User

    Publish the Application Publishing Applications Transferring Update Sets

  • Article Sources and Contributors 41

    Article Sources and ContributorsApp Creator Source: http://wiki.servicenow.com/index.php?oldid=232791 Contributors: Cheryl.dolan, Rachel.sienko, Vaughn.romero

    Creating a Custom Application Source: http://wiki.servicenow.com/index.php?oldid=235168 Contributors: Cheryl.dolan, Rachel.sienko, Vaughn.romero

    Creating a Custom Table Source: http://wiki.servicenow.com/index.php?oldid=232596 Contributors: CapaJC, Cheryl.dolan, Emily.partridge, G.yedwab, Guy.yedwab, Joseph.messerschmidt,Mark.stanger, Rachel.sienko, Steven.wood, Vaughn.romero, Vhearne

    Application Files Source: http://wiki.servicenow.com/index.php?oldid=189643 Contributors: Cheryl.dolan, Rachel.sienko

    Fix Scripts Source: http://wiki.servicenow.com/index.php?oldid=189888 Contributors: Rachel.sienko

    Publishing Applications Source: http://wiki.servicenow.com/index.php?oldid=231791 Contributors: Rachel.sienko, Vaughn.romero

    Conference Room Bookings Source: http://wiki.servicenow.com/index.php?oldid=234943 Contributors: Cheryl.dolan, Joseph.messerschmidt, Rachel.sienko

  • Image Sources, Licenses and Contributors 42

    Image Sources, Licenses and ContributorsImage:Applications.png Source: http://wiki.servicenow.com/index.php?title=File:Applications.png License: unknown Contributors: Rachel.sienkoImage:ApplicationFile.png Source: http://wiki.servicenow.com/index.php?title=File:ApplicationFile.png License: unknown Contributors: Rachel.sienkoImage:Warning.gif Source: http://wiki.servicenow.com/index.php?title=File:Warning.gif License: unknown Contributors: CapaJCImage:SystemApplications.png Source: http://wiki.servicenow.com/index.php?title=File:SystemApplications.png License: unknown Contributors: Rachel.sienkoImage:SystemDefinition.png Source: http://wiki.servicenow.com/index.php?title=File:SystemDefinition.png License: unknown Contributors: Rachel.sienkoImage:ApplicationTables.png Source: http://wiki.servicenow.com/index.php?title=File:ApplicationTables.png License: unknown Contributors: Rachel.sienkoImage:ApplicationsPicker.png Source: http://wiki.servicenow.com/index.php?title=File:ApplicationsPicker.png License: unknown Contributors: Rachel.sienkoImage:ConflictDialog.png Source: http://wiki.servicenow.com/index.php?title=File:ConflictDialog.png License: unknown Contributors: Rachel.sienkoImage:MoveFile.png Source: http://wiki.servicenow.com/index.php?title=File:MoveFile.png License: unknown Contributors: Rachel.sienkoImage:ContentpageUnload.png Source: http://wiki.servicenow.com/index.php?title=File:ContentpageUnload.png License: unknown Contributors: Rachel.sienkoImage:UpdateSet.png Source: http://wiki.servicenow.com/index.php?title=File:UpdateSet.png License: unknown Contributors: Rachel.sienkoImage:DeleteApplication.png Source: http://wiki.servicenow.com/index.php?title=File:DeleteApplication.png License: unknown Contributors: Rachel.sienkoImage:DeleteApplicationFinished.png Source: http://wiki.servicenow.com/index.php?title=File:DeleteApplicationFinished.png License: unknown Contributors: Rachel.sienkoImage:RestoreApplication.png Source: http://wiki.servicenow.com/index.php?title=File:RestoreApplication.png License: unknown Contributors: Rachel.sienkoImage:RestoreRecords.png Source: http://wiki.servicenow.com/index.php?title=File:RestoreRecords.png License: unknown Contributors: Rachel.sienkoImage:Live_company_feed.png Source: http://wiki.servicenow.com/index.php?title=File:Live_company_feed.png License: unknown Contributors: Rachel.sienkoImage:RequestTable.png Source: http://wiki.servicenow.com/index.php?title=File:RequestTable.png License: unknown Contributors: Rachel.sienkoImage:CreateModule.png Source: http://wiki.servicenow.com/index.php?title=File:CreateModule.png License: unknown Contributors: Rachel.sienkoImage:AutoNumber.png Source: http://wiki.servicenow.com/index.php?title=File:AutoNumber.png License: unknown Contributors: Rachel.sienkoImage:TableSecurity.png Source: http://wiki.servicenow.com/index.php?title=File:TableSecurity.png License: unknown Contributors: Rachel.sienkoImage:ExtendTable.png Source: http://wiki.servicenow.com/index.php?title=File:ExtendTable.png License: unknown Contributors: Rachel.sienkoImage:NewCMDBclass.png Source: http://wiki.servicenow.com/index.php?title=File:NewCMDBclass.png License: unknown Contributors: Rachel.sienkoImage:RecordProducer.png Source: http://wiki.servicenow.com/index.php?title=File:RecordProducer.png License: unknown Contributors: Rachel.sienkoImage:Caution-diamond.png Source: http://wiki.servicenow.com/index.php?title=File:Caution-diamond.png License: unknown Contributors: John.robertsImage:UIPolicyRelationships.png Source: http://wiki.servicenow.com/index.php?title=File:UIPolicyRelationships.png License: unknown Contributors: Rachel.sienkoImage:ShowParent.png Source: http://wiki.servicenow.com/index.php?title=File:ShowParent.png License: unknown Contributors: Rachel.sienkoImage:DescendantFiles.png Source: http://wiki.servicenow.com/index.php?title=File:DescendantFiles.png License: unknown Contributors: Rachel.sienkoImage:ShowFile.png Source: http://wiki.servicenow.com/index.php?title=File:ShowFile.png License: unknown Contributors: Rachel.sienkoImage:ShowRelatedRecord.png Source: http://wiki.servicenow.com/index.php?title=File:ShowRelatedRecord.png License: unknown Contributors: Rachel.sienkoImage:ApplicationFiles.png Source: http://wiki.servicenow.com/index.php?title=File:ApplicationFiles.png License: unknown Contributors: Rachel.sienkoImage:FixScripts.png Source: http://wiki.servicenow.com/index.php?title=File:FixScripts.png License: unknown Contributors: Rachel.sienkoImage:FixScriptTest.png Source: http://wiki.servicenow.com/index.php?title=File:FixScriptTest.png License: unknown Contributors: Rachel.sienkoImage:ProgressWorkers.png Source: http://wiki.servicenow.com/index.php?title=File:ProgressWorkers.png License: unknown Contributors: Rachel.sienkoImage:ApplicationFixScripts.png Source: http://wiki.servicenow.com/index.php?title=File:ApplicationFixScripts.png License: unknown Contributors: Rachel.sienkoImage:PublishApplication.png Source: http://wiki.servicenow.com/index.php?title=File:PublishApplication.png License: unknown Contributors: Rachel.sienkoImage:RoomTable.png Source: http://wiki.servicenow.com/index.php?title=File:RoomTable.png License: unknown Contributors: Rachel.sienkoImage:CampusChoices.png Source: http://wiki.servicenow.com/index.php?title=File:CampusChoices.png License: unknown Contributors: Rachel.sienkoImage:ElevatePrivilege.png Source: http://wiki.servicenow.com/index.php?title=File:ElevatePrivilege.png License: unknown Contributors: Rachel.sienkoImage:ReadRole.png Source: http://wiki.servicenow.com/index.php?title=File:ReadRole.png License: unknown Contributors: Rachel.sienkoImage:ShowApplication.png Source: http://wiki.servicenow.com/index.php?title=File:ShowApplication.png License: unknown Contributors: Rachel.sienkoImage:RequestsList.png Source: http://wiki.servicenow.com/index.php?title=File:RequestsList.png License: unknown Contributors: Rachel.sienkoImage:RequestForm.png Source: http://wiki.servicenow.com/index.php?title=File:RequestForm.png License: unknown Contributors: Rachel.sienkoImage:RequestModule.png Source: http://wiki.servicenow.com/index.php?title=File:RequestModule.png License: unknown Contributors: Rachel.sienkoImage:LocationDictionary.png Source: http://wiki.servicenow.com/index.php?title=File:LocationDictionary.png License: unknown Contributors: Rachel.sienkoImage:SearchIcon.png Source: http://wiki.servicenow.com/index.php?title=File:SearchIcon.png License: unknown Contributors: CapaJC, Rachel.sienkoImage:LocationLookup.png Source: http://wiki.servicenow.com/index.php?title=File:LocationLookup.png License: unknown Contributors: Rachel.sienkoImage:EmailNotification.png Source: http://wiki.servicenow.com/index.php?title=File:EmailNotification.png License: unknown Contributors: Rachel.sienko

    Building ApplicationsApp CreatorOverview Custom Application Development Example Video

    App Creator Tables Application Table Application File Table Application File Type Table Related Tables

    How the App Creator Works with Update Sets ServiceNow Applications Menus and Modules Enhancements EurekaDublin

    Creating a Custom ApplicationOverview Creating Applications Defining Tables for Applications Activating and Deactivating Applications

    Working on Applications Resolving Conflicts Moving Application Files to Applications Manually Adding Homepages and Content Pages to Applications Creating Update Sets

    Deleting Applications Restoring Deleted Records Restoring Deleted Records Prior to the Dublin Release

    Creating a Custom TableOverview Creating Tables Adding Columns Global Default Fields

    Creating Modules for Tables Adding Record Numbering Removing Record Numbering

    Creating Security Rules for Tables Extending a Table Example: Enabling Workflows for Tables that Extend Task Example: Creating a New CMDB Class

    Creating Record Producers for Tables Application FilesOverview Application File Records Applications Protected Application Files

    Relationships Between Application Files Navigating Application Files and Records Navigating Application File Lists Fix ScriptsOverview Creating Fix Scripts Testing Fix Scripts Running Fix Scripts Publishing ApplicationsOverview Publishing Applications Setting Limits for Publishing Data

    ExamplesConference Room BookingsOverview Audience

    Create an Application Record Build the Data ModelRequest Table Room Table Campus Choices Room Data Security

    Design the User InterfaceList and Form LayoutField Label Module

    Add Business Logic and AutomationPopulate the RequesterIdentify a RoomSend an Email Confirmation

    Test the Application Publish the Application Further Reading