Automatically send Purchase/Work Order to Vendor

Requirement

One common requirement to streamline the procurement process is setting up Maximo to automatically send Purchase Orders or Work Orders to a vendor or external contractor. I have seen this implemented in many different ways. However, the most common requirements are:

  • Trigger:
    • When a Purchase Order is Approved
    • When a Work Order is Approved/Scheduled/Assigned
  • Details:
    • Print out the Purchase Order Details or Work Order Details report, and attach it to the email.
    • The title of the email should contain key information such as the PO/WO number and Description. For example:
      • (Good) PO 1015 – Repair & Replace Faulty Pole light fittings throughout Flinders Station
      • (Bad) [Customer name] Purchase order details
    • The body of the email can contain some basic information about the ordered service and the contact details
  • Delivery:
    • PO: Deliver to the Vendor’s contact email. In case the Vendor record has many contacts, send the email to the selected contact specified in the PO record.
    • WO: deliver to the email associated with the responsible person on the external contractor side (e.g. the external labor specified in the Lead field, or the default person of the “Person Group” field, or the selected vendor’s contact)
    • The email sent should be logged in the Communication Log tab.

Simple Implementation

One common way to implement this requirement is to create an Automation Script that does the following:

  • Queue the PO or WO Detail report to send it to an email
  • Record the email in the WO/PO Communication log

The script can be created as an Action, which is used in the workflow when the PO or WO is approved, or it can be launched when the record changes to a certain status (e.g. APPR/SCHED/ASSIGNED) using an Attribute Launch Point on the Status field.

Below is the example script:

Advanced Implementation

The above method is simple and works well in most cases. However, in certain cases, we might have a few more advanced requirements:

  • The PO/WO detail sent to the Vendor also needs to be recorded for auditing purposes
  • Send emails in the background to optimise performance
  • Use Communication Template to:
    • Support complex email templates that are professionally formatted and have many parts dynamically populated from the details of the PO/WO record.
    • Avoid hardcoding email content. Allow the users to modify the template whenever they want

To address these requirements, we can implement it using an escalation as follows:

  • Filter:
    • Based on certain statuses.
      • For example: status in (‘APPR’, ‘SCHED’, ‘ASSIGNED’)
    • Should maximise index utilisation to make it as fast as possible.
      • For example: istask = 0 AND historyflag = 0)
    • Avoid sending duplicate emails.
      • For example: not exists(SELECT 1 FROM commlog c WHERE c.ownertable = ‘WORKORDER’ AND c.ownerid = workorder.workorderid)
  • Action:
    • Create an Action Automation Script that generates a PDF report and attaches it to the main PO/WO record
    • The sample code for this script is below:
  • Communication:
    • Create a Communication Template with the Recipients and the Message Title/Body formatted the way you like it.
    • Tick on the Comm Log Entry? checkbox if you want Maximo to record the sent emails in Communication Log
    • In the Attachments Folder tab, tick on the Attachment folder
Enable sending attachments when setting up Communication Template
  • How it works:
    • When the escalation runs, it will call the Action automation script first. This generates a PDF report and attaches it to the main record under the Attachment folder
    • After that, it will send out an email using the Communication Template. Since we configured the template to also attach any files in the Attachment folder, the email sent out also has the PO/WO details report attached to it.

Leave a Comment

Scroll to Top