How to Simultaneously Output the Same Document via Email and via Printer

Scenario: The business have made a request for the delivery note to not only be emailed to the M3 user but also to be printed to a particular office printer.

Currently the delivery note (MMS480PF) is emailed to a particular M3 user via the following runtime configuration (Figure 1):

code6
Figure 1: Runtime configuration for an EMAIL-only Delivery Note
  1. Open the Message
  2. Change the name fof the Delivery_Note process to EMAIL_Delivery_Note
  3. Copy the EMAIL_Delivery_Note process
  4. Paste the copied process and rename it Printer_Delivery_Note
  5. Right click on the Printer_Delivery_Note process and select Script…
  6. Insert the following code:

setdestpath("PrinterName"); //for more info on this click here

  1. Open the Runtime
  2. Right-click on each process node and select Settings…
  3. Uncheck the Select automatically checkbox
  4. Connect the new Printer_Delivery_Note process node to your Printer output connector (mine is named PCL6
    • The EMAIL_Delivery_Note process node should be alreadyu connected to the MAIL output connector
  5. Right-click on the each process node and select Connector Selection…
  6. Select the Variable Connection Type and enter a variable name (see Figure 2)
code7
Figure 2
  1. Make sure that the Default Connector is the PCL6 output connector for the new Printer_Delivery_Note process node and MAIL for the EMAIL_Delivery_Note process node (see Figure 3)
code8
Figure 3: Runtime configuration for an Emailed AND printed document
  1. Open the Message
  2. Right-click on the message node and select Script…
  3. Insert the following code:

$SelectedOutputConnector = “MAIL”;
CallProc(“EMAIL_Delivery_Note”);
$SelectedOutputConnector = “PCL6”;
CallProc(“Printer_Delivery_Note”);

Export and deploy and test!

Troubleshoot: M3 Users are not receiving output (Part 2)

Explanation: Users are complaining that their submitted jobs in M3 are not being received in their inboxes.

Problem Diagnosis

  1. Open MNS206 (M3 Output. Manage per Job)
  2. Change the Sorting order to 6-Output Status
  3. Type SND into the Sts column and type the date into the Ent dt column
  4. Press Enter

You now have a list of jobs that have the status SND (Sent) which means they have been sent but not saved or received by M3 – they have a status of SAV when they are successfully received by M3. Figure 1 indicates a sample job with SND.

1
Figure 1: A submitted job with status SND

Problem: The problem is with M3. You need to contact your M3 administrators and ask them to view its performance. They should especially check if any autojobs need to be restarted.

Once M3 has been fixed, all jobs with status SND will now automatically begin to hit StreamServe and produce output for users.

You do not need to resend jobs! 

You should monitor all traffic for a while and constantly refresh MNS206 to see jobs change status from SND to SAV (Sent & Saved).

Troubleshoot: M3 Users are not receiving output (Part 1)

Scenario: Users are complaining that their submitted jobs in M3 are not being received in their inboxes.

Problem Diagnosis:

  1. Open MNS206 (M3 Output. Manage per Job)
  2. Change the Sorting order to 6-Output Status
  3. Type MSG into the Sts column and type the date into the Ent dt column
  4. Press Enter

You now have a list of jobs that have the status MSG (Error Detected) – these jobs were sent during the downtime. Figure 1 indicates a sample job with MSG. Now You must find out what error has been detected.

50
Figure 1: A submitted job at status MSG
  1. Right-click on one of the MSG jobs and select Display
    1. The E panel is triggered
  2. The Message is CR_0025 and the description tells you that the server is not responding –  Figure 2 displays these details
49
Figure 2: Job error message onn MNS206/E panel

Problem: The problem is with StreamServe. The Control Center service is no longer running so it needs to be restarted.

Solution: 

  1. Click back to return to MNS206
  2. Open Control Center – the service will not be running
  3. Start the service

All jobs with status MSG will now automatically begin to hit StreamServe and produce output for users.

You do not need to resend jobs! 

You should monitor all traffic for a while and constantly refresh MNS206 to see jobs change status from MSG to SAV (Sent & Saved).

How to Easily Improve Traceability via M3 and your Delivery Note

Scenario: The Quality Department have informed you that they want the trailer number pirnted on every delivery note from now on however, the despatcher will only find out the trailer number at the time of loading.

For the solution I will use the Ext tracking no: textbox in the MWS410/F panel.

Solution Part 1: StreamServe

  1. Open the PageOut and add a label to the header section of your delivery note
  2. Enter the following text into the label: Trailer Number
  3. Drag the field AHOQETRN from the Field folder in the Message window and place it opposite (or beneath) the label Trailer Number
    1. If you have multiple pages you need to complete this step for each page
  4. Export and deploy the project

Solution Part 2: M3

  1. Open MWS410 (Delivery. Open Toolbox)
  2. Right-click on the delivery that you are currently despatching and select Change
  3. The panel MWS410/E opens however, you need to click Next (or hit Enter) to open panel F
  4. In the highlighted textbox in Figure 1, enter the trailer number which is being used for the despatch and click Next.
  5. Click the Back button until you return to MWS410 and proceed with the despatch as normal.

48
Figure 1: Snapshot of MWS410/F
When the Delivery Note is generated it will display the trailer number used for the despatch.

 

 

How to control the display of a label based on the value of a spool-field

SCENARIO: Some of your customers require their VAT number to be displayed on the invoice document. Your M3 customer master file only has the VAT number for several customers however you do not want to have the label VAT Number appearing with no accompanying value on an invoice.

  1. Open the OIS1990H event and transform the spool-field 0HWYVRNO into a variable 
  2. Open the PageOut and insert a Static Text object (this will be your label) to your canvas
  3. Rename the label to VAT Number
  4. In the Message window, collapse the Variable folder and drag the variable $0HWYVRNO to your canvasto the right/below of the label.
34
Figure 1: The Variable folder on the PageOut canvas
  1. Right-click on the label and select Edit Script…
  2. Insert the following code:

    if ($0HWYVRNO = “”) {
    skip();
    }
    else {
    {}
    }

The label VAT Number will now only appear if a value exists for the spool-field 0HWYVRNO. If the spool-field 0HWYVRNO value is blank then the label will be skipped (i.e. not appear).

Export and deploy and test!

How to output all subsequent characters following a particular character in a string

Scenario: You have to output all the subsequent characters following the ‘-‘ character of a field value coming from a datastream however, the string length of the value can vary from 3 characters on-wards, i.e.  the value is never fixed.

    1. Open the process.
    2. Add the variable version of the field you wish to format.
    3. Right-click on the variable and select Edit Script…
    4. Insert the following code:

    $a = $lotnumber;

    //searches string of $a for ‘-‘ and gets a position number
    $b=stridx($a,”-“);

    //adds 1 to the ‘-‘ position number to get next position
    $c = num($b)+ 1;

    //gets substring starting at ‘next’ position
    $lotnumber = substr($lotnumber,$c);

    1. Click OK.

    Export, deploy and test!

    • If the field value is 1234-567 you will output 567
    • IF the field value is -123 you will output 123
    • If the field value is 34-4533345689 you will output 4533345689

How to output the final x number of characters in a variable-length string

Scenario: You have to output the final three characters of a field value coming from a datastream however, the string of the value can vary from 3 characters on-wards, i.e.  the value is never fixed.

    1. Open the process.
    2. Add the variable version of the field you wish to format.
    3. Right-click on the variable and select Edit Script…
    4. Insert the following code:

    //Places the length of the string into variable $a
    $a=strlen($1MWWBANO);

    // Subtracts 2 from the length
    $b = num($a) – 2;

    //Variable $1MWWBANO takes the substring of its value based on the subtracted //variable $b as the position and ‘3’ as the number of subsequent places that are //outputted
    $1MWWBANO = substr($1MWWBANO,$b,3);

    1. Click OK.

    Export, deploy and test!

    • If the field value is 1234567 you will output 567
    • IF the field value is 123 you will output 123
    • If the field value is 34-4533345689 you will output 689