ION Actions examples for Supply Chain
Required fields before approval
Mandate that specific PO line attributes are populated before submitting for approval
{
"enabled": true,
"title": "Purchase line items must have a need date",
"target": "PURCHASEORDERLINE",
"eventType": "UPDATE",
"ruleType": "VALIDATION",
"errorState": "ALLOW",
"context": "{ purchaseOrderLine(id: $id) { id needDate } }",
"code": "if context.get('changes', {}).get('purchaseOrderLines', {}).get('status', {}).get('new') == 'requested' and context.get('purchaseOrderLine', {}).get('needDate') is None: raise ValidationError()"
}Mandate that specific PO header (custom) attributes are populated before submitting for approval
{
"enabled": true,
"title": "Purchase requires a justification before it can be ordered"
"target": "PURCHASEORDERLINE",
"eventType": "UPDATE",
"errorState": "ALLOW",
"context": "{ purchaseOrderLine(id: $id) { purchaseOrder {id attributes {key value}} } }",
"code": "if context.get('changes', {}).get('purchaseOrderLines', {}).get('status', {}).get('new') == 'requested' and any(attribute.get('key') == 'PO Justification' and not attribute.get('value') for attribute in context['purchaseOrderLine'].get('purchaseOrder', {}).get('attributes', [])): raise ValidationError()"
}Purchase Approvals
We used to rely on ION Actions to enforce purchase order approval levels, but we now have a first class method to do so that is easily understandable and maintained. Check that out here.
Other Example Rules:
Receipt line items must have a location
Required fields for part creation
Last updated
Was this helpful?