Auto-Creation of POs from MRP Planned Orders with Custom Approval Routing

Auto-Creation of POs from MRP Planned Orders with Custom Approval Routing
100%Manual PO Creation Eliminated
DailyMRP Automation Frequency
CustomApproval Routing Logic
ZeroMissed Procurement Deadlines

Background - The Client Challenge

A manufacturing client approached us with a pain point in their NetSuite MRP process.

While NetSuite's MRP engine could generate Planned Orders, it lacked two critical features:

  • Automatic Conversion to Purchase Orders (POs): Users had to manually convert every planned order into a real PO.
  • Custom Approval Routing: The client's procurement process required approval routing based on department, amount, or item category, which NetSuite does not natively apply to MRP outputs.

This manual process was slowing down procurement, increasing the risk of missed purchase timelines, and bypassing their internal approval policy.

Our Objective

We designed a SuiteScript-based automation to:

  • Convert MRP Planned Purchase Orders into actual POs automatically after MRP runs.
  • Apply custom approval logic before the PO is submitted for processing.

Our Solution - Script Workflow

We implemented a Scheduled Script that runs daily after the MRP process completes.

Identify Planned Orders

Identify Planned Orders

  • Runs a Saved Search to pull all MRP-generated Planned Orders for items requiring purchasing.
Create Purchase Orders Automatically

Create Purchase Orders Automatically

  • For each Planned Order, the script loads item and vendor details.
  • Creates a new Purchase Order (record.Type.PURCHASE_ORDER).
  • Populates fields such as item, quantity, location, and vendor directly from the Planned Order.
Apply Custom Approval Routing

Apply Custom Approval Routing

  • Sets the approver dynamically based on department, PO amount, or item category.
  • Routes the PO through the client's established internal workflow.
Error Handling and Reporting

Error Handling and Reporting

  • Logs any errors and emails a summary report to procurement and operations teams.

Code Snippet

var po = record.create({
  type: record.Type.PURCHASE_ORDER,
  isDynamic: true
});

po.setValue({ fieldId: 'entity', value: vendorId });
po.setValue({ fieldId: 'location', value: locationId });

po.selectNewLine({ sublistId: 'item' });
po.setCurrentSublistValue({ sublistId: 'item', fieldId: 'item', value: itemId });
po.setCurrentSublistValue({ sublistId: 'item', fieldId: 'quantity', value: qty });
po.commitLine({ sublistId: 'item' });

// Set custom approver
po.setValue({ fieldId: 'custbody_custom_approver', value: approverId });

var poId = po.save();

Business Impact

Time Savings

Time Savings

Eliminated manual PO creation from Planned Orders, saving hours of administrative work each week.

Policy Compliance

Policy Compliance

Enforced custom approval rules without requiring user action.

Operational Speed

Operational Speed

Accelerated the procurement cycle immediately after MRP runs, ensuring production deadlines are met.

REVIEWS

What Clients Say About Us