# Workflow Action: Generate 856 ## Overview The **Generate 856** workflow action allows you to automatically generate Ship Notice/Manifest (856) EDI transactions from Item Fulfillment records using NetSuite workflows. This provides a programmatic alternative to the manual "Generate 856" button. ## Use Cases Use this workflow action to: * Automatically generate 856 documents when item fulfillments are marked as shipped * Trigger EDI generation as part of a larger fulfillment workflow * Eliminate manual steps in your shipping process * Ensure ASN/Ship Notices are sent immediately upon shipment completion ## Supported Transaction Types This workflow action supports: * 856 (Ship Notice/Manifest) * Simplified Shipment Notice The workflow action applies to **Item Fulfillment** records. ## Prerequisites * The workflow action script must be deployed to your NetSuite account * Script ID: `customscript_orderful_generate_856_wa` * Deployment ID: `customdeploy_orderful_generate_856_wa` * The script must be in RELEASED status * Customer must have 856 or Simplified Shipment Notice enabled in their Orderful configuration ## Setup Instructions ### 1. Deploy the Script The workflow action script should be automatically deployed when the Orderful bundle is installed. Verify deployment: 1. Navigate to **Customization > Scripting > Scripts** 2. Search for "Orderful | Generate 856 WA" 3. Verify the script status is **Released** 4. Check that the deployment is **Deployed** ### 2. Create or Edit a Workflow To add the Generate 856 action to a workflow: 1. Navigate to **Customization > Workflow > Workflows** 2. Create a new workflow or edit an existing one 3. Set the **Record Type** to **Item Fulfillment** 4. Add a workflow state where you want the action to execute ### 3. Add the Workflow Action Within your workflow state: 1. Click **Add Action** under the appropriate trigger type (e.g., After Field Edit, On Entry, etc.) 2. Select **Execute Script** as the action type 3. Configure the action: * **Script**: Select "Orderful | Generate 856 WA" * **Deployment**: Select "Orderful | Generate 856 WA" 4. Optionally add conditions to control when the action executes ### 4. Set Workflow Conditions (Optional) To ensure the action only runs for appropriate fulfillments, add conditions such as: * **Status** = Shipped * **Customer** has 856 enabled (check via custom field) * **Shipment Status** = Shipped * Any custom field criteria specific to your business logic ## Example Workflow Configuration ### Auto-Generate on Shipment This example automatically generates 856 documents when a fulfillment is marked as shipped: **Workflow Settings:** * **Record Type:** Item Fulfillment * **Trigger:** After Record Submit * **Init On Create:** True **Workflow State:** * **Name:** Auto-Generate 856 on Ship * **Trigger Type:** On Entry **Workflow Action:** * **Type:** Execute Script * **Script:** Orderful | Generate 856 WA * **Conditions:** * Status = Shipped * Customer: 856 Enabled = True ### Conditional Generation Based on Field This example only generates 856 when a custom checkbox is enabled: **Workflow Action Conditions:** * Status = Shipped * Send EDI 856 = True (custom field) ## What the Action Does When executed, the workflow action: 1. Loads the Item Fulfillment record 2. Sets the `Ready to Process (Fulfillment)` field to `true` 3. Sets the `Force Autosend` field to `true` 4. Saves the record This triggers the standard Orderful fulfillment processing logic, which: * Generates the 856 EDI message payload * Creates an Orderful Transaction record * Dispatches the transaction to Orderful via API (if autosend is enabled) This is the same functionality as clicking the "Generate 856" button manually. ## Error Handling If the workflow action encounters an error: * The error is logged to the script execution log (Error level) * The workflow will halt or continue based on your workflow configuration * Check **Customization > Scripting > Script Execution Log** for detailed error information * Any errors during EDI generation will be captured on the resulting Orderful Transaction record ## Troubleshooting ### Action Not Executing * Verify the script deployment is **Released** and **Deployed** * Check workflow conditions are being met * Review the workflow execution log * Ensure the user role has permission to execute the script ### 856 Not Being Generated * Verify the customer has 856 enabled in Orderful configuration * Check that ISA IDs are configured for the customer * Verify the fulfillment has required data (shipping info, items, etc.) * Review the Orderful Transaction record for error messages * Check the script execution log for detailed error information ### Duplicate 856 Documents * Add a condition to prevent re-triggering on already processed fulfillments * Check for existing Orderful Transaction records before executing * Use workflow state management to prevent multiple executions ## Best Practices 1. **Add Status Checks:** Only trigger on shipped fulfillments to avoid processing incomplete records 2. **Check Customer Configuration:** Verify customer has 856 enabled before generating 3. **Avoid Duplicate Processing:** Ensure workflow doesn't trigger multiple times for the same fulfillment 4. **Test in Sandbox:** Thoroughly test your workflow in a sandbox environment before deploying to production 5. **Monitor Execution:** Regularly review script execution logs during initial rollout 6. **Consider Timing:** Trigger after all shipment data is finalized (tracking numbers, cartons, etc.) ## Integration with Packing Process If you use the Orderful packing functionality, consider these workflow triggers: * **After Packing Complete:** Trigger 856 generation after cartons are finalized * **After SSCC Generation:** Trigger after SSCC codes are assigned * **Custom Packing Flag:** Use a custom field to indicate packing is complete and ready for EDI ## Related Documentation * [Generate and Send Workflow Action](workflow-action-generate-and-send.md) * [Auto Pack Documentation](../TransactionHandling/856/README.md) (if exists) * [Packing App Documentation](../SPA/packing-app/README.md) (if exists) * NetSuite Workflow Guide: Help Center > Workflow ## Support For issues or questions: * Review the script execution log for detailed error information * Contact Head in the Cloud Development, Inc. at [gurus@headintheclouddev.com](mailto:gurus@headintheclouddev.com) * Check the Orderful support documentation