Enabling Attachments in Form and Object Rules

Attachments to database records let you associate detailed comments or Uniform Resource Locators (URLs) with transaction data. After defining attachment characteristics through Database Definition, the programmer must enable the attachments where desired by adding the appropriate statements to the Form Definition file and the object rules file.

To enable attachments for a system code

  1. Set up the attachments for the file in Database Definition.
  2. Build the dictionary.
  3. Reorganize the dictionary.

    For instructions on steps 1, 2, and 3, see Applying Database Definition Changes and Lawson Administration: Server Setup and Maintenance.

  4. Open the form definition file for the program that displays the attachments:

    $LAWDIR/productline/rpg/systemcoderpg/SYSCODERPGSRC/programcodeD.SCRN

  5. Add one or both of the following lines to the $FORM section of the form that you want to enable an attachment for.

    $COMMENTKN KN1, KN2, Knn

    - or -

    $URLKN KN1, KN2, KNn

  6. Add the COMMENT or URL entries to the object window that displays the attachment.

    For detailed information on the COMMENT or URL entries, see Object Windows.

  7. Compile the object rules for the system code. At the Qshell command line, type

    srgen productline [systemcode . . .]

    For detailed instructions, see Compiling Form and Object Rules.