Purchase Order Processing Transformations
This page explains how transformations validate purchase order data when a PO changes status, and how to set them up to enforce your organization's business rules.
When to Use Processing Transformations
Use processing transformations when you need to enforce data quality or business rules at specific points in the procurement workflow. Common examples include:
- Requiring a supplier contact name before an order can be placed
- Validating that every order line has a cost centre assigned before approval
- Ensuring a delivery address is specified before moving to Order Placed
- Checking that the PO total does not exceed a budget limit
How It Works
When a PO transitions to a new status, xAssets can run a processing transformation to validate the PO data. These transformations belong to the Purchase Order Processing transformation class.
Each transformation is linked to a specific PO status via Purchasing > Purchase Order Status in the Purchasing menu. When a PO moves to a status that has an associated transformation:
- If the transformation completes without error, the status change (and any other edits) is saved.
- If the transformation returns an error, the error message is displayed to the user and the PO changes are not saved. The PO remains at its previous status.
You can have different transformations for different statuses. For example, one transformation validates data when moving to Order Placed, and a different one runs when receiving assets.
Setting Up a Processing Transformation
- Create a transformation in the Purchase Order Processing class via Admin > Transformations.
- Write the validation logic using AMSX or SQL. The transformation should return an error message if validation fails, or complete silently if everything is valid.
- Navigate to Purchasing > Purchase Order Status.
- Edit the PO status that should trigger the validation and link it to your transformation.
- Test by creating a PO and attempting to move it to the relevant status with both valid and invalid data.
Transformation Parameters
Each processing transformation receives three parameters:
| Parameter | Description |
|---|---|
| BeforeXML | The XML representation of the purchase order before the status change |
| AfterXML | The XML representation of the purchase order after the status change and any other edits |
| PurchaseOrderID | The ID of the purchase order record |
These parameters allow the transformation to compare old and new values and validate that all required data for the new status is present. For example, you could parse the AfterXML to check that a SupplierContact field is populated when the status is changing to Order Placed.
Warning: If a processing transformation contains a bug that always returns an error, users will be unable to move POs to that status. Test transformations thoroughly in a development environment before deploying to production. If a transformation is blocking POs unexpectedly, an administrator can remove the transformation link from the PO status to unblock users while the issue is investigated.
For general information about transformations in xAssets, see the Configuration Guide.
Related Articles
- Procurement Process — The end-to-end procurement workflow
- Procurement Configuration Options — Detailed configuration options
- Transformations Overview — Introduction to data transformations
- Purchase Order Status — The lifecycle of a purchase order