
When ecommerce orders move fast, manual invoicing steps become costly bottlenecks. For Primary Arms, delays and errors in adding tracking numbers to invoices were directly impacting SPS Commerce integrations, order completion, and cash flow.
GIR Software Services designed a NetSuite-native automation solution that synchronizes tracking numbers from Item Fulfillments to Invoices, enforces SPS Commerce character limits, and automatically flags invoices as ready for transmission, removing manual steps from a mission‑critical fulfillment workflow.
If your team is spending time copying tracking numbers between records, it’s time to automate.
Learn how GIR delivers scalable NetSuite automation: Link
Problem Statement
Primary Arms integrates with SPS Commerce Commerce to exchange order and invoice data with major retailers. However, the invoicing workflow relied on manual data entry for tracking numbers.
Key Challenges
- Missing tracking numbers on invoices required by SPS Commerce
- Delayed invoice transmission, slowing order finalization
- High operational overhead due to manual validation
- Increased risk of integration failures and chargebacks
Without automation, the fulfillment-to-invoicing handoff became a reliability risk across high order volumes.
Solution and Approach
Rather than introducing new middleware or external tools, GIR implemented a NetSuite Workflow Action Script directly on the Sales Order lifecycle.
This ensured:
- Automation runs exactly when invoices become eligible
- All logic stays inside NetSuite’s transaction flow
- No changes required to the existing SPS Commerce integration
Core Process Flow
- Trigger: Sales Order status update (fully billed)
- Lookup: Find all related Invoices and Shipped Item Fulfillments
- Prioritize: Sort records by most recent transaction date
- Validate: Identify invoices missing tracking numbers
- Transfer: Pull tracking data from fulfillments
- Normalize: Enforce SPS Commerce 50‑character limit
- Update: Mark invoice as ready for SPS Commerce transmission
This design ensures invoices are SPS Commerce compliant before export, not after errors occur.
Technical Implementation: Workflow Action Script Logic

The solution was deployed as a Workflow Action Script on the Sales Order record, triggered by a specific status change.
Record Identification and Filtering
The script begins by scanning the Links sublist on the Sales Order:
- Filters for:
- Invoices
- Item Fulfillments with Shipped status
- Sorts both lists by transaction date (descending)
This guarantees that the latest fulfillment and invoice data are processed first—critical when partial shipments exist.
Invoice and Tracking Update Loop
Each eligible Invoice is evaluated and updated through a controlled loop:
- Invoice Load & Validation
- Checks if Bill of Lading field is already populated
- If populated → skip
- If empty → proceed
- Item Fulfillment Tracking Extraction
- Pulls raw tracking data from:
- custbody_pa_tracking_numbers
- Pulls raw tracking data from:
- Tracking Normalization & SPS Commerce Limit Enforcement
- Replaces <BR> tags with commas
- Splits into individual tracking numbers
- Concatenates values only until total length ≤ 50 characters
- Removes spaces to meet SPS Commerce formatting requirements
- Invoice Field Updates
- custbody_sps_billofladingnumber ← formatted tracking
- custbody_sps_carrierpronumber ← same value
- custbodyintegrationstatus ← Ready for SPS Commerce (internal value = 1)
- Save Invoice
This guarantees every invoice leaving NetSuite is integration‑ready.
Relevant Custom Fields
The automation interacts with the following critical data points:
- Item Fulfillment
- custbody_pa_tracking_numbers (source tracking data)
- Invoice
- custbody_sps_billofladingnumber
- custbody_sps_carrierpronumber
- custbodyintegrationstatus
By standardizing field usage, the workflow remains maintainable and transparent for accounting and operations teams.
Business Value and Impact
The automation delivered measurable improvements across fulfillment, accounting, and integration reliability.
Operational Efficiency
- Eliminated manual tracking number entry
- Reduced invoice handling time
- Freed staff to focus on exception management
Integration Reliability
- Guaranteed population of required SPS Commerce fields
- Enforced character limits to prevent rejections
- Reduced invoice resubmissions
Faster Cash Flow
- Invoices reach SPS Commerce faster
- Faster retailer acceptance
- Shorter payment cycles
Improved Customer Experience
- Accurate tracking on invoices
- Fewer post‑shipment inquiries
- Stronger retailer compliance scores
This automation transformed invoicing from a manual risk point into a controlled system process.
Conclusion
For high‑volume ecommerce operations, small process gaps can create large financial and operational risks. By automating SPS Commerce tracking population directly inside NetSuite, Primary Arms gained reliability, speed, and compliance; without adding system complexity.
GIR Software Services specializes in identifying exactly where automation creates the biggest operational return and delivering solutions that fit seamlessly into your NetSuite environment.
Ready to Automate Your NetSuite Fulfillment and Invoicing?
If your team is still manually moving data between records or correcting integration failures, there’s a better way.
Explore our NetSuite automation services: Link
See how we solve real client challenges: Link
Talk with a NetSuite automation expert: Link
Why Choose GIR Software Services
GIR Software Services delivers more than scripts we build end‑to‑end NetSuite automation strategies that improve how your business operates.
What Sets GIR Apart
- Deep NetSuite Transaction Expertise
We understand how Sales Orders, Fulfillments, Invoices, and integrations actually behave in production environments. - Integration‑Ready Automation Design
Our solutions align with platforms like SPS Commerce, EDI, and marketplace integrations. - Business‑Driven Architecture
Every script is built to support finance, fulfillment, and compliance, not just technical success. - Scalable and Maintainable Solutions
Clean logic, documented processes, and supportable configurations ensure long‑term value.
If your NetSuite processes are holding your team back, GIR Software Services is ready to help you move faster, with confidence.
Know a business we could help?



