2.3 Adding Constants and Fields

Next we will be adding the customer number, field, title, date, time, and function keys to the record which will be the Customer Inquiry screen. On the bottom left-hand side of the design area is the palette. The palette contains icons for creating records, fields and constants. To find out the function of an icon, place your mouse over each icon in the palette to obtain fly-over help.

Adding Some Constants and Fields

Follow these steps:

  1. Select the record FMT01 from the right-hand pane of the CODE Designer window.
  2. Right-click on the record and select Design from the pop-up menu. The Design page appears containing a record.
  3. From the palette, click on the date constant icon .
  4. Position the cursor in the upper-left corner of the Design area and left-click. A new date field is added to the screen.
  5. From the palette, click on the system constant . Position the cursor in the upper-right corner of the Design area and left-click. A new system constant is added to the screen.
  6. In order to create multiple text constants, enable the sticky checkbox from the palette and then click on the text constant on the palette.
  7. Position the cursor in the top-center of the Design area and left-click. A new text constant is added to the screen.
  8. Select Selected > Properties to bring up the Properties notebook for the text constant.
  9. In the Properties notebook, select the Basics page for the text constant.
  10. In the Text field, type in the name Customer Inquiry.
  11. Select the Color tab.
  12. Click on the white icon and click Add. Close the Properties notebook.

Creating Another Text Constant

You need to add another text constant and field for the Customer Number.

Follow these steps:

  1. Click on the Design area a few lines down from where you created the Customer Inquiry text constant to create another text constant.
  2. Select Selected > Properties to bring up the Properties notebook for the text constant.
  3. In its properties notebook, type Enter a customer number and press Enter in the Text field.
  4. Select the Color tab.
  5. Click on the blue icon and click Add.
  6. Click on the Design area a few lines down from where you created the last constant.
  7. In the Properties notebook, select the Basics page for the text constant.
  8. Type Customer Number in the Text field. Press Enter.
  9. Click on the Design area to the right of the Customer Number text constant (leaving enough space for a 7 digit customer number).
  10. In its properties notebook, type Number, F4 for list in the Text field. Press Enter. Close the Properties notebook.

Adding Function Keys

Next you need to add some function keys to the Customer Inquiry screen.

Follow these steps:

  1. To enter the function keys for the Customer Inquiry screen, click on the bottom portion of the Design area to create a new text constant. If your Design area is small you may need to use the scroll bar to move to the bottom of the Design area.
  2. Select Selected > Properties to bring up the Properties notebook for the text constant.
  3. In its properties notebook, type F3=Exit, F4=Prompt, F6=Print, F12=Cancel in the Text field. Press Enter. Close the Properties notebook.
  4. From the palette, disable the sticky checkbox. Now, click each text constant and left align them. You may notice another text constant added when you click on the Design area again. Delete this text constant as it is not needed.
  5. From the palette, click on the named field icon and click on the Design area to the right of the Customer Number text constant.
  6. Right click to bring up the Properties notebook. Type CUSTNO in the Field field.
  7. For its Type, click on the character icon.
  8. For its Usage, click on the B icon for this constant to accept both input and output.
  9. Set the Total length to 7. Leave the specified row and column position.
  10. Close the properties notebook. The Design area looks like the following:

Verifying the DDS Logic

Now you can check to make sure the DDS logic is correct before continuing.

Follow these steps:

  1. Select the FMT01 record from the DDS Tree.
  2. Select Tools > Verify file or use the Verify file icon wpe5.jpg (964 bytes).
  3. Select the Listing tab and scroll down to the bottom of the page. If there are errors, they will be listed here. You can also select the Error List tab to check the errors. Fix any errors before you continue.
  4. The only error you may receive is for the ALTHELP keyword. You can ignore the message or you can delete the ALTHELP keyword. To delete the ALTHELP keyword select File Keywords in the DDS tree. You can then select the keyword and delete it. When you verify the DDS again after the change, you will receive no error messages.

Click on to indicate that you've done all the steps.