Custom Process Inbound Transactions

A guide for supporting non-native EDI transaction workflows and types in NetSuite

Overview

Custom Process allows inbound EDI transactions to be received and stored in NetSuite without automatic processing. This provides flexibility for implementing custom business logic or manual review workflows for specific transaction types.

For outbound custom processing, see Custom Process Outbound Transactions.

How It Works

Transaction Flow

  1. Transaction Reception: Inbound EDI transactions are received from Orderful through the standard polling mechanism
  2. Custom Process Detection: During the inbound processing MapReduce, the system checks if isProcessAsCustom is enabled for the transaction type on the customer's EDI configuration
  3. Status Assignment: If enabled, the transaction status is set to Pending - Custom Process instead of processing automatically
  4. Manual/Custom Handling: The transaction remains in this state for custom processing via:
    • Custom SuiteScript (Scheduled Scripts, MapReduce, or Suitelets)
    • Manual review and processing
    • Third-party integrations

Key Components

Transaction Status

  • Status Value: PendingCustomProcess (script ID: transaction_status_pending_cust_process)
  • Purpose: Indicates the transaction has been received but requires custom processing before NetSuite records are created

Configuration

Custom Process is configured at the EnabledTransactionType level:

  • Field: isProcessAsCustom (boolean)
  • Field ID: custrecord_edi_enab_trans_cust_process
  • Location: Customer/Vendor entity → Orderful EDI Customer Transactions subtab
  • Path: Entity → Enabled Transaction Types → Process as Custom checkbox

Configuration Steps

1. Enable Custom Process for a Transaction Type

  1. Navigate to the Customer or Vendor record in NetSuite
  2. Go to the Orderful EDI Customer Transactions subtab
  3. Find or add the transaction type you want to process as custom
  4. Check the Process as Custom checkbox
  5. Save the record

2. Monitor Custom Process Transactions

Custom Process transactions can be found by:

  1. Navigating to the Orderful Transaction list view in NetSuite
  2. Filtering by Status = "Pending - Custom Process"
  3. The transactions will contain the complete EDI message payload in the Message field

Orderful Transaction Fields

When a custom process inbound transaction is staged, the following fields are available on the Orderful Transaction record (customrecord_orderful_transaction):

Field IDDescription
custrecord_ord_tran_messageThe raw inbound EDI message payload (JSON). This is the primary field developers use for custom processing.
custrecord_ord_tran_entityCustomer or Vendor entity this transaction is associated with
custrecord_ord_tran_documentDocument type (e.g., 850, 875, 945)
custrecord_ord_tran_statusCurrent status — will be Pending - Custom Process when first staged
custrecord_ord_tran_directionDirection: 1 (In)
custrecord_ord_tran_isa_senderSender ISA ID from the inbound transaction
custrecord_ord_tran_receiverReceiver ISA ID
custrecord_ord_tran_errorError message field — populate this if your custom processing fails
custrecord_orderful_use_custom_processBoolean flag indicating this record was created via custom process (read-only)
custrecord_orderful_po_numberPurchase order number extracted from the inbound transaction

Transaction Statuses

StatusScript IDWhen Used
Pending - Custom Processtransaction_status_pending_cust_processInitial state for inbound custom process transactions. The raw message is staged but no NetSuite records have been created.
Successtransaction_status_successDeveloper sets this after successfully processing the transaction and creating the appropriate NetSuite records.
Errortransaction_status_errorDeveloper sets this if custom processing fails. Write a meaningful error message to custrecord_ord_tran_error.

Use Cases

Common Scenarios for Custom Process

  1. Complex Validation Requirements

    • Transactions requiring special business rule validation
    • Multi-step approval workflows
    • Data enrichment from external systems
  2. Non-Standard Transaction Types

    • EDI transaction types not fully supported by standard processing
    • Custom document types specific to your business
  3. Manual Review Workflows

    • High-value transactions requiring manual approval
    • New trading partner onboarding
    • Exception handling for specific conditions
  4. Integration with External Systems

    • Transactions that need to be processed by external ERP/WMS systems
    • Data synchronization with third-party applications
    • Custom routing based on business logic

Implementation Example

Processing Custom Transactions via Scheduled Script

/**
 * @NApiVersion 2.1
 * @NScriptType ScheduledScript
 */
define(['N/record', 'N/search', 'N/log'], function (record, search, log) {

  function execute(context) {
    // Search for pending custom process transactions
    const results = search.create({
      type: 'customrecord_orderful_transaction',
      filters: [
        ['custrecord_ord_tran_status', 'is', 'transaction_status_pending_cust_process'],
        'AND',
        ['custrecord_ord_tran_direction', 'is', 1]  // Inbound
      ],
      columns: [
        'internalid',
        'custrecord_ord_tran_message',
        'custrecord_ord_tran_entity',
        'custrecord_ord_tran_document'
      ]
    }).run().getRange(0, 100);

    results.forEach(function (result) {
      const transactionId = result.getValue('internalid');

      try {
        const messagePayload = JSON.parse(
          result.getValue('custrecord_ord_tran_message')
        );

        // Implement your custom processing logic here
        processCustomLogic(messagePayload, result);

        // Update transaction status after successful processing
        record.submitFields({
          type: 'customrecord_orderful_transaction',
          id: transactionId,
          values: {
            custrecord_ord_tran_status: getStatusId('transaction_status_success')
          }
        });

        log.audit({
          title: 'Custom Process Success',
          details: 'Processed Orderful Transaction ' + transactionId
        });

      } catch (error) {
        // Mark as error with details
        record.submitFields({
          type: 'customrecord_orderful_transaction',
          id: transactionId,
          values: {
            custrecord_ord_tran_status: getStatusId('transaction_status_error'),
            custrecord_ord_tran_error: error.message || String(error)
          }
        });

        log.error({
          title: 'Custom Process Error',
          details: 'Failed to process Orderful Transaction ' + transactionId + ': ' + error.message
        });
      }
    });
  }

  /**
   * Helper: Look up the internal ID of a transaction status by script ID
   */
  function getStatusId(scriptId) {
    const results = search.create({
      type: 'customlist_orderful_transaction_status',
      filters: [['scriptid', 'is', scriptId]],
      columns: ['internalid']
    }).run().getRange(0, 1);
    return results.length > 0 ? results[0].getValue('internalid') : null;
  }

  function processCustomLogic(payload, searchResult) {
    // Your custom processing logic here
    // Example: parse the inbound message, create NetSuite records,
    // apply business rules, etc.
  }

  return { execute: execute };
});

Comparison: Inbound vs Outbound Custom Process

AspectInboundOutbound
What the SuiteApp providesRaw EDI message payload, staged as an Orderful Transaction with status "Pending - Custom Process"Nothing — native generation is disabled. Developer must create the message.
Developer's responsibilityProcess the staged data and create NetSuite records (Sales Orders, Fulfillments, etc.)Generate the outbound message payload and populate it on the Orderful Transaction record
Initial statusPending - Custom ProcessPending (or Ready To Send if set by the developer at creation)
How to completeSet status to Success after processingPopulate the message, then send via button, status change, or WorkflowAction
UI impactNo native records are createdGenerate buttons are hidden; "Send to Orderful" button is shown

For outbound custom processing details, see Custom Process Outbound Transactions.

Important Notes

Limitations

  1. No Automatic Processing: Transactions marked for custom process will not:

    • Create NetSuite transactions automatically
    • Generate automatic acknowledgments
    • Trigger standard validation or mapping
  2. Manual Status Management: You must update the transaction status in your custom logic. If you do not implement an automated status update, the transaction will remain in "Pending - Custom Process" indefinitely.

Best Practices

  1. Error Handling: Implement try/catch blocks in custom processing scripts. Write meaningful error messages to custrecord_ord_tran_error when processing fails.
  2. Logging: Use N/log to maintain audit trails of custom processing activities.
  3. Status Updates: Always update the transaction status after processing — set to Success on completion or Error on failure.
  4. Documentation: Document your custom processing logic for each transaction type.
  5. Testing: Test custom processing in a NetSuite sandbox environment before deploying to production.