• No results found

Example: Add a Menu Option to the Options Menu

In document SCT 5.1.0 System Tailoring Volume 2 (Page 44-50)

This example adds a menu option to the options menu of the

am.display.joinfile format. The purpose of this menu option is to ping a device according to the IP Address in the record.

The basic flow for this example is demonstrated in the flow chart below. For each process step shown in the flowchart, a more detailed step-by-step procedure follows.

Identify form and menu to add a

feature to

Navigate to the Object within the Document Engine

Reference the Process Definition

from the State Definition

Add an option to the Displayscreen

list of options

Create the Process Definition

Start

Identify the screen name and the form name:

1 Login as administrator.

2 From the Services tab, select Inventory Management > Assets.

3 Select Screen Name from the View Menu. A check mark appears next to Screen Name to indicate it is turned on. The screen name, am.search, is displayed in the lower right corner of the message line.

4 In the Type field, select Computer from the drop-down menu.

5 Click Search.

Identify the Object:

1 Press CTRL+Shift+D+E to open the RAD Debugger.

2 Type d file.name in $L.object.

3 Press Enter.

The word device appears in the debugger. Therefore, the file name of the object is device.

4 Click on the X in the upper-right corner to close the debugger.

5 Click OK to return to the Asset Information search screen.

Navigate to the object within the Document Engine:

1 Open a new session of ServiceCenter.

2 Login as administrator.

9 Select device from the record list.

The Object Definition is displayed. Notice that the search state is am.search, which is the screen name from earlier in the procedure.

Reference the Process Definition from the State Definition

1 From the Object Definition record, click the magnifying glass next to the

Note: If using a pre-5.0.1 client, click the triangle next to the Default State field.

2 The State Definition form is displayed.

3 Type zping at the bottom of the Display Action column.

4 Type zam.zping.process at the bottom of the Process Name column.

5 Type true at the bottom of the Condition column.

6 Click Save.

7 Click on the zam.zping.process field.

8 Click Find.

9 The Process Definition form is displayed.

Since ServiceCenter did not find the process name, it gives the user the opportunity to create one.

Create the Process Definition

1 Insert your cursor in the Initial Expression field.

2 Type $L.command=”ping;”+nullsub(network.address in $L.file, “0.0.0.0”) 3 Select the RAD tab.

4 Type us.launch.external in the RAD Application field.

Note: us.launch.external accepts the same type of commands as the Windows command line.

5 Type true in the Condition field.

6 Type name in the Parameter field.

7 Type $L.command in the Parameter Values field.

8 Click Add.

Notice that the Action for Option 926 is “do nothing”. Since the RAD Application, us.launch.external, performs everything that needs to be done to execute a ping, 926 is a good one to copy.

Also notice that Option 927 does not exist.

5 Click the 926 button.

6 The display screen record for Option 926 is displayed.

7 Type zping in the Action field.

8 Replace 926 with 927 in the GUI option field.

9 Replace 926 with 927 in the Text option field.

10 Type Ping this Device in the Default Label field.

11 Delete the text in the Condition field.

12 Type true in the Condition field.

13 Delete the text in the RAD Application field.

14 Delete the text in the Names field.

15 Delete the text in the Values field.

16 Click Add.

A confirmation message appears in the message line.

Test the Document Engine Addition

1 Revert to the first session of ServiceCenter which is at the Asset Information search screen(am.search),.

2 In the Type field, type Computer.

3 Click Search.

4 Find a computer that has the IP Address field populated.

5 Insert your cursor in the IP Address field.

6 Select Options Menu > Ping this Device.

The command line appears and attempts to ping the IP Address from the Computer record. If the machine you are working on has network access, the ping will succeed. If it does not have network access, the ping will fail.

CHAPTER 2 Validity Table Processing

The validity table allows you to define a field’s valid values in a list of values, a list of ranges, a secondary file, and customized RAD subroutines. These values are then used for validating operator-entered data and for lookup processing (similar to ServiceCenter Find and Fill). These various validity definitions are consolidated in one file, resulting in easy maintenance. This can be of significant benefit when multiple forms access one database.

The value of a field is validated against a list of values (e.g. 10, 20, 30, or 40), a list of ranges (e.g. 50 through 60), a secondary file (similar to the Format Control secondary file query) and customized RAD subroutines. The fields within a file are validated in a particular order (e.g. fieldx, fielda, fieldg), in alphabetical sequence (e.g. fielda, fieldg, fieldx) or according to a field validation sequence number. The default processing of the validation routine validates the value of a field against the definitions in the validity table. If the current value of a field is invalid, a summary list of valid values and ranges is

Each validity table definition contains four levels of definition:

„ Field Summary

„ Secondary File Query Information

„ Values Summary

„ Range Summary

When it is necessary to differentiate the maintenance procedures of these different levels, the order of the documentation is Field level, Secondary Queries level, Values level, and Ranges level. For instance, the section on updating shows how to update Validation Records at the Field Level, the Value Level, and then the Range Level.

Important: All applications and procedures described in this chapter refer to a unique maintenance application that specifically supports validity table maintenance. If you access any of the validity table databases with any other application (such as Database

Manager), you must ensure that all data is properly structured in order for the validity definitions to work correctly at run time.

Peregrine Systems recommend that you always follow the procedures outlined in this chapter.

In document SCT 5.1.0 System Tailoring Volume 2 (Page 44-50)

Related documents