Auto PO Matching
What does this script do?
Trigger
Full Script
# Read PO number from the document
po_nr = get_field_value(document_data, "purchase_order", "")
if po_nr:
# Clean up PO number: remove prefix and whitespace
po_nr = po_nr.strip()
if po_nr.upper().startswith("PO"):
po_nr = po_nr[2:].strip()
if po_nr.startswith("-") or po_nr.startswith(" "):
po_nr = po_nr[1:].strip()
# Update cleaned PO number
set_field_value(document_data, "purchase_order", po_nr)
# Trigger automatic PO matching
auto_po_match_for_purchase_orders(user, document_data, po_nr)Step-by-Step Explanation
What happens after matching?
Functions Used
Last updated
Was this helpful?