M3_H5_CreateMail

Use this H5 script to select rows in a list that you can include in an email using the address defined in 'Email Address. Open' (CRS111).

The type of email address that is searched for is based on these tables and the fields following this sequence:
  • CUNO: "01", (Customer)
  • HLDR: "01", (Customer)
  • SUNO: "02", (Supplier)
  • PYNO: "11", (Payer (customer))
  • SPYN: "14", (Payee (supplier))
  • EMNO: "03", (Employee)
  • RESP: "04", (User)
  • BUYE: "04", (User)
  • SMCD: "04", (User)
  • USID: "04" (User)
If the field CUNO is present for example, (CRS111) is queried for the email indicated in type "01", (Customer). If no email address is found but the field SUNO also exists in the list, (CRS111) is queried again with the email indicated in type “02” (Supplier) instead. This process continues until an email address is found. If no address is found, the 'To' field in the email is going to be empty.
Note: This script only works in the new H5 UI.

Script arguments

  • Argument to be used on 'Planned Purchase Order. Open' (PPS170) to send only the list of available planned purchase orders.

    In PPS170: Send mail,8,8

    Argument Example Optional Descriptions
    Button name In PPS170: Send mail No You can use any button name which depends on your requirement.
    Target row for the button 8 No Specify any row selection for the button placement.
    Target column for the button 8 No Specify any column selection for the button placement.
    Email subject empty Yes You can customize the email subject manually in the supported application in your system.
    Email body empty Yes You can customize the email body manually in the supported application in your system.
  • Argument to be used on 'Planned Purchase Order. Open' (PPS170) to send a list of available planned purchase orders through email with a short message.

    In PPS170: Send mail,8,8,Urgent,Hello

    Argument Example Optional Descriptions
    Button name In PPS170: Send mail No You can use any button name which depends on your requirement.
    Target row for the button 8 No Specify any row selection for the button placement.
    Target column for the button 8 No Specify any column selection for the button placement.
    Email subject Urgent Yes The subject to be added to the email. You can customize the email subject manually in the supported application in your system.
    Email body Hello Yes A short content to be added to the email body. You can customize the email body manually in the supported application in your system.
  • Argument to be used on 'Customer. Open' (CRS610/B) to send existing customer records through email with only the email subject.

    Email,5,5,Program CRS610

    Argument Example Optional Descriptions
    Button name Email No You can use any button name which depends on your requirement.
    Target row for the button 5 No Specify any row selection for the button placement.
    Target column for the button 5 No Specify any column selection for the button placement.
    Email subject Program CRS610 Yes The subject to be added to the email. You can customize the email subject manually in the supported application in your system.
    Email body empty Yes You can customize the email body manually in the supported application in your system.

Creating an email using the script

  1. Navigate to any program.
  2. Add the M3_H5_CreateMail script and the argument.

    See the procedure for adding a script in the M3 Core User and Administration Library (Cloud).

  3. Select any line from the grid record. You can select multiple lines to include in the email body.
  4. Click the button created by the script. This action triggers the Save As dialog containing the file with a .eml extension.
  5. Browse to the location where to save the file and click Save.
  6. Open the downloaded file with the email application on your system. You can review the selected lines that are added to the email body. You can also change the email subject and body manually.