NetSuite Administrator study materials
NetSuite Administrator study resources

Self-Approval Loop in a Vendor Bill Workflow

NetSuite Administrator · Put your knowledge to work in context.

All case studies

Self-Approval Loop in a Vendor Bill Workflow

Vendor bills over $25,000 require approval from the department head of the bill's department, escalating to the CFO when the department head is the submitter or when Department is blank. A SuiteFlow workflow with six states was built by a prior administrator and is now failing in three ways: bills submitted by a department head sit in 'Pending Approval' indefinitely, blank-department bills skip approval entirely, and approvers receive two identical emails for each state. Volume is roughly 400 bills a month. Finance wants approval status visible on the bill and filterable in a saved search. The workflow is deployed on Before Record Submit, uses a 'Set Field Value' action plus a Send Email action in every state, and currently has no release status set. The sandbox is refreshed monthly and was last refreshed three weeks ago.

1. Diagnose each of the three symptoms in workflow terms.

Read the worked answer

Each symptom maps to a specific SuiteFlow behavior:

  • Stuck at Pending Approval. The workflow has no transition that matches when the approver equals the submitter. A transition whose condition is 'next approver is department head' evaluates true, re-enters the same state, and waits for an approval that the submitter cannot give. Workflow transitions require an explicit condition; when none match, the record simply rests in the current state.
  • Blank department skips approval. If the entry condition or the first transition tests Department is not empty, a blank department fails the condition and the workflow either does not initiate or falls through to the approved state. That is a silent bypass, not a safe default.
  • Duplicate emails. Two Send Email actions fire: one on state entry and one on the transition, or the email action is on the state and the record is saved twice (workflow re-entry, script resubmission). Verify by checking the workflow's state list and the Email Message activity on the record.

Also note the missing release status: an unreleased or 'Testing' workflow behaves unpredictably between environments, and this alone can explain behavior differences between sandbox and production.

2. Decide whether to keep SuiteFlow, extend it with SuiteScript, or rebuild, and justify the choice for 400 bills a month.

Read the worked answer

Four hundred bills a month is low volume, so performance is not the deciding factor - determinism and maintainability are.

Keep SuiteFlow for routing and notifications, but move approver determination into a User Event script. A beforeSubmit script can read the department, look up the department head, compare the submitter, and write results to two custom fields: custbody_approver and custbody_approval_path ('Dept Head' or 'CFO'). The workflow then has simple, testable conditions on those fields rather than complex lookups across states.

Handle blank department explicitly. Default to the CFO path and set a flag so the bill is visibly escalated rather than silently approved.

Do not rebuild in pure SuiteScript unless the rules become genuinely complex (matrix by amount, vendor category, subsidiary). A script-only approval engine means re-implementing state, reminders, and audit history that SuiteFlow already provides and that finance can inspect.

Clean up the email duplication by keeping a single Send Email action on state entry and removing the transition copy. Before go-live, set release status to Released and re-test in a fresh sandbox.

3. What test cases and deployment controls would you require before release?

Read the worked answer

Build a test matrix that deliberately hits the failure modes, not just the happy path:

  • Bill over $25,000 with a department head submitter -> routes to CFO, never returns to the submitter.
  • Bill over $25,000 with blank department -> routes to CFO and shows an escalation flag.
  • Bill exactly $25,000 and $25,000.01 -> confirms the boundary is 'greater than', not 'greater than or equal'.
  • Bill under $25,000 -> no approval required, status is visible and correct.
  • Two saves without changes -> exactly one email per state.
  • Approval via the standard Approvals portlet and via email -> state and audit trail agree.

Deployment controls: set the workflow release status to Released in sandbox and re-verify after copying; confirm the workflow's initiation and trigger-on settings do not conflict with the new beforeSubmit script ordering; run with a non-admin test role so permission differences surface; and after production release, monitor for records stuck in any state older than 48 hours through a saved search that finance can own.