VERSICH

Automated Customer Item Stock Listing Generation in NetSuite

Automated Customer Item Stock Listing Generation in NetSuite

Background - The Client Challenge

A wholesale distribution client wanted a one-click way to generate three different PDF reports for each customer, directly from the customer record in NetSuite:

  1. Client Copy - for the customer’s own reference.
  2. Price List - showing applicable pricing.
  3. Stock Insight - current inventory status.

The reports needed to:

  • Include items previously purchased by the customer and additional items from the Item Pricing tab.
  • Display real-time stock levels at the time of generation.
  • Exclude specific items based on rules defined at the item record level, either for all customers or specific ones.
  • Be automatically stored in the File Cabinet and linked to the customer record.

Our Solution

We designed a SuiteScript-driven automation for seamless PDF generation and storage:

  1. User Event (UE) Script - Button Creation
    • Added a custom button on the customer record.
    • Clicking the button triggers a redirect to a Suitelet script that handles report generation.
  2. Suitelet Script - Data Collection & PDF Creation
    • Runs multiple Saved Searches to gather:
      • Excluded items from item record settings.
      • Additional items from the customer’s Item Pricing tab.
      • All items purchased by the customer.
      • Current stock levels for all qualifying items.
    • Generates three separate PDFs with conditional column visibility based on the report type.
    • Saves all generated PDFs to the File Cabinet.
  3. File Access & Customer Record Integration
    • After PDF creation, the user is redirected back to the customer record.
    • A banner notification with clickable links to the new files appears on the screen.
    • Another UE script lists all generated files in a dedicated tab on the customer record for easy access.

Business Impact

  • High Volume Usage: Since Q3 2024, over 10,000 PDFs generated for 3,500+ customers.
  • Time Savings: Eliminated manual data compilation for stock and price lists.
  • Accuracy: Stock levels are captured in real-time, ensuring up-to-date customer communication.
  • Improved Service: Sales teams can instantly provide customers with tailored stock and pricing information, improving responsiveness and satisfaction.