This chapter provides an overview of a sample script that you can create with Oracle's JD Edwards EnterpriseOne Autopilot and discusses how to create the script.
Although JD Edwards Autopilot can be used to create a script to verify any application, this sample script uses the A/P Standard Voucher Entry (accounts payable standard voucher entry) application (P0411). This section includes step-by-step instructions for developing a sample script for the application. This sample script does not provide examples of every function or feature of JD Edwards Autopilot. For example, this script tests an interactive application and does not launch a universal batch engine (UBE). Consult other sections of this guide if you need information about a function that is not included in the sample script.
The steps for writing a script vary from one script to another. The precise steps that you include in a script depend on your use of a particular application.
This section provides an overview of sample script creation and discusses how to:
Launch an application and form.
Declare a variable.
Add a new form.
Type data in a header control.
Create a valid values list.
Type data in a grid column.
Update the repeat count.
Update the database.
Set the value of a variable.
Return to a previous form.
Enter data to a Query By Example (QBE) line.
Find records.
Select records and delete them from the database.
Complete the script.
You use JD Edwards Autopilot to create customized scripts that apply to the applications that you most often use. The sample script presented in this chapter illustrates how you use many of the commands that are included in JD Edwards Autopilot. However, the sample script does not include all context and action commands, and it does not represent a definitive method for using JD Edwards Autopilot. For example, this script tests functions that you perform in an interactive application. You can also test the launch and submission of a UBE, which requires that you write a different set of commands.
Launching the application from JD Edwards Autopilot establishes one basic scripting context that you need for many other scripting commands that you insert and run. Launching an application does not have to be the first command that you script in a JD Edwards Autopilot session. However, the Application command is often at least one of the first commands that you script.
Selecting an application in JD Edwards Autopilot also requires that you select a form that is part of the application. After you launch an application from JD Edwards Autopilot, you can script a variety of additional context and action commands. For example, after you have established the context as a form, you can then script inputs for header controls, grid columns, and QBE lines. After you establish one of these contexts, you can script clicking buttons to access different forms or to perform functions within the active form.
To launch an application and form:
From the desktop or the appropriate directory, launch JD Edwards Autopilot.
The JD Edwards Autopilot splash screen appears, followed by the JD Edwards Autopilot window.
In the File menu, select the New option.
The command pane and Script pane are unpopulated.
In the Command menu, select Application.
The Application list is populated, while the Menu list remains unpopulated.
Click an application code, such as P0411 for the A/P Standard Voucher Entry application.
JD Edwards Autopilot populates the Menu list with items that appear under these headings:
Fast Path, which corresponds to the fast path command that JD Edwards Autopilot will use to launch the application.
Menu Text; for example, Standard Voucher Entry.
Version, which specifies which version of the application will be launched.
Click a Fast Path command to launch the application, such as 3/G0411, Standard Voucher Entry, version ZJDE0001.
Click the Insert button in the command pane.
Note. If the Playback button on the toolbar is activated, JD Edwards Autopilot launches the application, and the form specified in the Fast Path appears (in this case, the Supplier Ledger Inquiry form).
Before you can use a variable as a source of input, you must first declare it, or give it a name, to specify the place in which you store the value. You can declare a variable at any point in the script, but after you declare a variable, you can place it at the top of the script to make it global. That way, you can set its value at any point in the script. If you make the variable global, you can launch multiple applications within the script and use the stored value in any of the applications. If you declare a variable after you launch an application, you can drag the Declare command for the variable to the top of the script to make it global.
For this script, you use a previous document number to retrieve voucher entry data. You declare the variable early in the script so that you have a place already established to store the previous document number as soon as you know what it is.
To declare a variable:
In the Command menu, select Variables.
Type a name for the variable in the New Variable field.
For the sample script, call the variable Previous Document #.
In the Source of Value list, select Unknown/None.
Note. Selecting Unknown/None indicates that you merely want to give the variable a name at this point. You do not yet set its value.
Click the Insert button.
JD Edwards Autopilot inserts the Declare command for the variable after the Supplier Ledger Inquiry Form command line. At this point, you can use the variable only within that Form node because it is attached to the Form node.
Click the Declare command line in the Script pane to highlight it.
Drag the Declare command line until it is on top of the Application command line. When the indicator arrow is pointing up, release the mouse button.
You have now attached the Declare command line to the Begin Script node, and you can use a value that you set for the variable at any point in the script.
For this sample script, you move from the Supplier Ledger Inquiry form to the Enter Voucher - Payment Information form. To do so, you script clicking the Add button to change forms. You also select Enter Voucher - Payment Information from the Next Form list so that the Form command line in JD Edwards Autopilot matches the active form.
To add a new form:
From the Command menu, with the Playback button activated, select the Press Toolbar Button option.
In the Button list, select the Press Standard Button option.
Note. The options listed for Press Standard Button in JD Edwards Autopilot correspond to the buttons on the toolbar in the form.
Click Add.
In the Next Form list, select the name of the form that appears in the software when you click Add–the Enter Voucher - Payment Information form in this example.
Click the Insert button.
JD Edwards Autopilot adds the commands that you insert in the Script pane. In the playback mode, the Enter Voucher - Payment Information form appears in the software.
Note. If you select the Unknown/None option from the Next Form list (step 4), you must complete these additional steps. You must script a Form command line that corresponds to the form that is active in the software. At all times, the most current Form command line in the JD Edwards Autopilot Script pane must correspond to the form that is active in the software. If the command line in the Script pane does not correspond to the active form in the software, you cannot continue scripting.
With the Playback button activated so that the software is active, note the name of the software form that is active–the Enter Voucher - Payment Information form in this example.
In the Command menu, select Form.
The system displays a list of all forms within the current application.
Select the name of the active form from the Form list.
In this example, select Enter Voucher - Payment Information.
Click Insert.
In the Script pane, a Form command line appears that includes the name of the selected form.
Continue the sample script by adding commands to type inputs in header controls. Like the Application and Form commands, the Header command is a context command; it establishes the context in which you take further actions.
To type data in a header control:
In the Command menu, select the Set Header Control Value option.
In the Header Control list, select the name of a header control where you want to input data–for example, Company.
Note. The header control that you select in JD Edwards Autopilot is highlighted with a BlueCue.
Select one of these as the input source for the control:
Literal Value
Valid Values List
Variable
UDC Visual Assist Value
Form Interconnect Visual Assist Value
Clear
Set Focus
In this sample script, select Literal Value. When you select an input source, JD Edwards Autopilot provides a caption for the value selection list. The caption depends on the source of input.
Click inside the unpopulated Literal Value list and type 1.
Click the Insert button.
JD Edwards Autopilot types the scripted input in the Company header control in the Enter Voucher - Payment Information form. JD Edwards Autopilot encloses literal values in quotes in the Script pane.
Continue to script inputs in header controls by selecting the Set Header Control Value option in the Command menu, and then selecting a control, a source of input, and a value.
For this sample script, you script inputs in the header control Long Address Number. However, instead of entering a literal value in the control, use a valid values list as the input source.
A valid values list consists of values that you collect and store under a specified name. You use a valid values list if, for example, you need to input more than one value in a header or grid column. These types of valid values lists exist:
List of literal values
Simple database query
For this script, you create a list of literal values, which contains values that you assign. With a simple database query, JD Edwards Autopilot draws the values from a database that you select. You can continue to enter literal values in each header control. However, you can include as many values in the valid values list as you want. Each time that you play back the script; JD Edwards Autopilot automatically inserts one of the values in the appropriate header control.
If the value that you want to insert in a header or grid column is constant, select a literal value. However, if the value is likely to change, you can create a valid values list so that JD Edwards Autopilot inserts a new value each time. In this example, the long address number is different for each vendor, so create a valid values list and give it the name Vendors.
To create a valid values list:
In the Tools menu, select Generate Valid Values List.
Select the List of Literal Values option in the Select Data File Type dialog box.
Click Next.
Type a file name in the File Properties list; for this example, name the list Vendors.
Enter one or more values in the Enter Values list.
The values should appear vertically stacked in the box.
Click Finish.
In the Command menu, select Set Header Control Value.
In the Form/Subform Hierarchy list, select the appropriate form or subform.
In the Header Control list, select the name of a header control where you want to input data; for example, Long Address Number.
Select Valid Values List as the source of input.
Select the name Vendors, which is the name of the valid values list that you created.
Click the Insert button.
JD Edwards Autopilot types the first value in the list in the Long Address Number control in the Enter Voucher - Payment Information form. JD Edwards Autopilot identifies the valid values list in the Script pane with a backslash, the name that you assigned to the list, and the extension .atd.
Complete these tasks:
Script an input to the header control Business Unit. Use a literal value of 1.
Script an input to the header control DateForGLandVoucherJULIA. Use a literal value of 063005.
Script an input to header control DocVoucherInvoiceE, using a list of literal values that you named Sequential 5-Digit Numbers.
When you have inserted inputs in each of the header controls, the Script pane should contain five Type To action commands within the Header node.
Next, script inputs in the grid columns. For this sample script, make voucher payment inputs in the grid columns. The Grid command, like the Header command, is a context command; it establishes the grid column in the form as the environment where you take additional actions.
The names of the grid columns in the Grid Column list of the JD Edwards Autopilot command pane match the names of the grid columns on the form. When you select the name of a grid column from the Grid Column list, a BlueClue appears as an arrow over the corresponding grid column in the form.
For the sample script, enter vouchers in multiple rows of the grid columns of the form. You can enter literal values in each grid row, but it is easier to create a valid values list and then update the repeat count of the command line. For this script, type inputs in the Gross Amount and Remark grid columns.
To type data to a grid column:
Create a list of literal values that contains five values and name it Random Dollar Amounts.
This list contains gross amounts paid to vendors.
From the Command menu, select Set Grid Cell Value.
The command pane includes these lists:
Grid Column
Source of Input
In the Form/Subform Hierarchy list, select the appropriate form or subform
Select the name of a grid column from the Grid Column list; for example, select Gross Amount.
Select Valid Values List as the source of input.
Select Random Dollar Amounts.
Click the Insert button.
Repeat steps 1 through 6 to script an input in the Remarks column.
Name the list of literal values Random JE Explanations. This list contains explanations for each entry in the Gross Amount column, such as Rent.
After you insert inputs in each of the grid columns, the Script pane should contain two Type To action commands within the Detail Information (grid) node.
Because the source of input includes two lists of literal values that contain five values each, you change the repeat count for this node so that each of the five values is input in the grid during playback.
To update the repeat count :
If the playback mode is activated, disable it by clicking the Playback button in the toolbar.
In the Script pane, select Detail Information, which is the node that you need to update.
In the command pane, review these lists:
Define repeat count from
Repeat Count
Select Literal Value from the Define repeat count list.
In the Repeat Count list, type a number.
In this case, you type 5, because you want to script entering five separate values that you included in the valid values lists.
Click Update.
Note. The repeat count in the Detail Information node is now 5. If you play back the script, JD Edwards Autopilot loops through this node five times. Each time it loops, JD Edwards Autopilot inserts in the Gross Amount and Remark grid columns a different value from the valid values lists.
Click the Playback button on the toolbar to select the playback function.
After you script the entries in the Enter Voucher - Payment Information form, you update the database with the new entries by clicking OK. For this script, you also write a new Form command because clicking OK opens a new form.
In the new form, you enter data, click OK to add it to the database, and then return to the previous form by writing a new Form command.
Note. Before preforming these steps, create a list of literal values to use in Account Number column of the Enter Voucher - G/L Distribution form. Name this list Random JE Account Numbers.
See Creating a List of Literal Values.
To update the database and confirm a new form:
In the Command menu, select the Press Toolbar Button option.
Review these lists in the command pane:
Button
Next Form
The Button list in the command pane has a default value of Press Standard Button. For this script, under Press Standard Button, the options match these buttons on a form:
OK
Delete
Cancel
Select the OK option from the Button list.
From the Next Form list, select the form that follows when a user clicks OK for this application and version.
For the sample script, you select Enter Voucher - G/L Distribution.
Click Insert.
The Enter Voucher - G/L Distribution form appears. Credit the full voucher payment amount to a particular account number. After you credit the account, update the database, and then return to the Enter Voucher - Payment Information form. To do so, complete these tasks:
Enter an account number in the appropriate grid column in the G/L Distribution form.
Click the OK button to update the database.
Confirm the Enter Voucher - Payment Information form.
Note. You can create the list of literal values before you write the script. You can also enter a valid literal value in the Account Number column.
To enter data, update the database, and return to a previous form:
Create a list of literal values.
Name the list Random JE Account Numbers. This list contains valid G/L bank account numbers.
In the Command menu, select Set Grid Cell Value.
In the Grid Column list, select Account Number.
Select Valid Values List as the source of input.
Select Random JE Account Numbers.
Click Insert.
After you enter data in the Account Number grid column in the Enter Voucher - G/L Distribution form, and distribute the amount from the Enter Voucher - Payment Information to the indicated account number, you update the database and return to the Enter Voucher - Payment Information form.
In the Command menu, select the Press Toolbar Button option.
Select the Standard Button option.
Select OK.
In the Next Form list, select Enter Voucher - Payment Information, and then click the Insert button.
After you return to the Enter Voucher - Payment Information form, retrieve the previous document number. You will use it later to search in the Supplier Ledger Inquiry form for the data you input in the Gross Amount and Remarks grid columns in the Enter Voucher - Payment Information form. You need to retrieve and store the document number. You accomplish this by assigning its value to the variable that you declared earlier. The variable that you declared earlier has only a name, Previous Document #. Its value must be derived from a source that you select.
To set the value of a declared variable:
In the Command menu, select Variables.
In the Existing Variable list, select the name of the variable that you declared earlier in the script.
In the Source of Value list, select one of these:
Literal Value
Valid Values List
Variable
Header Control Data
Grid Cell Data
In this sample script, retrieve and store the previous Enter Voucher - Payment Information document number. Because the previous document number appears in a header control, select Header Control Data as the source of value.
Select or type a value.
In this case, JD Edwards Autopilot populates the value selection list with the names of the header controls in the Enter Voucher - Payment Information form. The value selection list, therefore, is called Header Control. Select Previous Document.
Click Insert.
You have now assigned a value to the variable that you named Previous Document #. You have told JD Edwards Autopilot to derive that value from the header control Previous Document in the form Enter Voucher - Payment Information. JD Edwards Autopilot stores that value in the declared variable. Because you previously made the variable global, you can use this value at any point that you select in the script.
When you return to the previous form, enter the value of the variable in the QBE line on the Supplier Ledger Inquiry form. In the sample script, click Cancel to return to the Supplier Ledger Inquiry form. Select the Press Toolbar Button option from the Command menu and select Cancel from the Press Standard Button options in the Button list. You then select the next form that appears when you click the Cancel button. Therefore, you select Supplier Ledger Inquiry from the Next Form list.
To return to a previous form:
In the Command menu, select Press Toolbar Button.
Select the Cancel option from Standard Button in the Button list.
Select the Supplier Ledger Inquiry form from the Next Form list.
Click the Insert button.
In the software, the Supplier Ledger Inquiry form becomes active. In the JD Edwards Autopilot Script pane, the Form command line displays Supplier Ledger Inquiry.
Because you have assigned a value to the declared variable, Previous Document #, you can now use the value that you stored.
You decide to enter the stored value, the previous document number, to the QBE line of the Supplier Ledger Inquiry form, then script clicking the Find button to retrieve the values that you entered to the grid in the Enter Voucher - Payment Information form.
To enter data in a QBE line:
In the Command menu, select Set QBE Cell Value.
Select the grid column Document Voucher Invoice Entry from the Grid Column list.
Select Variable from the Source of Input list.
In the value selection list, select the name of the variable that you declared; remember, it also now contains the value that you set.
Click the Insert button.
JD Edwards Autopilot inputs the previous Enter Voucher - Payment Information document number, which you stored in the variable that you named Previous Document #, in the QBE line of the grid, in the Document Voucher Invoice Entry column.
To find the values that you entered in the Enter Voucher - Payment Information form, click Find. Because you do not move to a new form, do not select another form from the Next Form list before clicking the Insert button.
To find records:
In the Command menu, select the Press Toolbar Button option.
Select Standard Button in the Button list, and then select Find.
You do not need to select an option from the Next Form list because you are remaining on the Supplier Ledger Inquiry form.
Click the Insert button.
The grid contains the voucher entries that relate to the document number that you input in the Document Voucher Invoice Entry grid column in the QBE line.
Next, script the deletion of records from the database. These records appear in the detail area of the Supplier Ledger Inquiry form because you scripted clicking the Find button in the previous task. To delete these records, you must select them, and then script clicking Delete.
When the script plays, the records that you select to delete in this task are actually deleted, just as they would be in a live session. Before you perform this task, verify that you are in a test environment and do not click the Insert button until you are sure that you have selected the correct records to delete. JD Edwards Autopilot automatically clicks OK in the Confirm Delete dialog box that appears when you have selected a grid line for deletion. You cannot click OK or Cancel.
To select records and delete them from the database:
In the Command menu, select the Select Grid Row option.
In the Form/Subform Hierarchy list, select the appropriate form or subform
In the command pane, select from the Source of Row Number list.
Type a literal value of 1 in the value selection list.
By typing this value, you select the row that contains the record that you want to delete.
Select the single-click option in the Action on grid row list.
This command selects the row in the detail area of the grid.
Click the Insert button.
In the Command menu, select the Press Toolbar Button option.
Click Select Standard Button in the Button list, and then select Delete.
Click the Insert button.
JD Edwards Autopilot clicks OK on the Confirm Delete form that appears in the software and deletes the record that you selected. You can repeat this command as many times as necessary to delete any and all records that you need to delete.
At the conclusion of the scripting, exit all open applications. For the sample script, click the Cancel button. Because you started on the Supplier Ledger Inquiry form, this command enables you to exit the A/P Standard Voucher Entry program (P0411) and complete the script.
To complete the script:
In the Command menu, select the Press Toolbar Button option.
Select Standard Button, and then select Cancel.
Because you are exiting the application, do not select an option from the Next Form list.
Click Insert.
Note. By clicking Cancel, you return to the starting point of JD Edwards EnterpriseOne software. You should end each scripting session by clicking Cancel or Close, especially if you intend to create additional scripts. Leaving windows open can impede playback of scripts and make it difficult to write additional scripts.
In the File menu, select Save.
Type a file name in the File Name field.
Click Save.
You have completed the sample script. While creating the script, you launched an application, selected a form and version associated with the application, and accessed forms by clicking buttons. You typed data in header controls, grid columns, and QBE lines. You derived that data from literal values that you typed in the value selection list and from valid values lists that you created and then selected from the value selection list. You added the data to the database, retrieved it, and deleted it. You declared a variable, set its value, and used it as a source of input in a QBE line. At the end, you canceled the application and saved the script.