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
- Transaction Reception: Inbound EDI transactions are received from Orderful through the standard polling mechanism
- Custom Process Detection: During the inbound processing MapReduce, the system checks if
isProcessAsCustomis enabled for the transaction type on the customer's EDI configuration - Status Assignment: If enabled, the transaction status is set to
Pending - Custom Processinstead of processing automatically - 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
- Navigate to the Customer or Vendor record in NetSuite
- Go to the Orderful EDI Customer Transactions subtab
- Find or add the transaction type you want to process as custom
- Check the Process as Custom checkbox
- Save the record
2. Monitor Custom Process Transactions
Custom Process transactions can be found by:
- Navigating to the Orderful Transaction list view in NetSuite
- Filtering by Status = "Pending - Custom Process"
- 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 ID | Description |
|---|---|
custrecord_ord_tran_message | The raw inbound EDI message payload (JSON). This is the primary field developers use for custom processing. |
custrecord_ord_tran_entity | Customer or Vendor entity this transaction is associated with |
custrecord_ord_tran_document | Document type (e.g., 850, 875, 945) |
custrecord_ord_tran_status | Current status — will be Pending - Custom Process when first staged |
custrecord_ord_tran_direction | Direction: 1 (In) |
custrecord_ord_tran_isa_sender | Sender ISA ID from the inbound transaction |
custrecord_ord_tran_receiver | Receiver ISA ID |
custrecord_ord_tran_error | Error message field — populate this if your custom processing fails |
custrecord_orderful_use_custom_process | Boolean flag indicating this record was created via custom process (read-only) |
custrecord_orderful_po_number | Purchase order number extracted from the inbound transaction |
Transaction Statuses
| Status | Script ID | When Used |
|---|---|---|
| Pending - Custom Process | transaction_status_pending_cust_process | Initial state for inbound custom process transactions. The raw message is staged but no NetSuite records have been created. |
| Success | transaction_status_success | Developer sets this after successfully processing the transaction and creating the appropriate NetSuite records. |
| Error | transaction_status_error | Developer sets this if custom processing fails. Write a meaningful error message to custrecord_ord_tran_error. |
Use Cases
Common Scenarios for Custom Process
-
Complex Validation Requirements
- Transactions requiring special business rule validation
- Multi-step approval workflows
- Data enrichment from external systems
-
Non-Standard Transaction Types
- EDI transaction types not fully supported by standard processing
- Custom document types specific to your business
-
Manual Review Workflows
- High-value transactions requiring manual approval
- New trading partner onboarding
- Exception handling for specific conditions
-
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
| Aspect | Inbound | Outbound |
|---|---|---|
| What the SuiteApp provides | Raw 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 responsibility | Process 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 status | Pending - Custom Process | Pending (or Ready To Send if set by the developer at creation) |
| How to complete | Set status to Success after processing | Populate the message, then send via button, status change, or WorkflowAction |
| UI impact | No native records are created | Generate buttons are hidden; "Send to Orderful" button is shown |
For outbound custom processing details, see Custom Process Outbound Transactions.
Important Notes
Limitations
-
No Automatic Processing: Transactions marked for custom process will not:
- Create NetSuite transactions automatically
- Generate automatic acknowledgments
- Trigger standard validation or mapping
-
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
- Error Handling: Implement try/catch blocks in custom processing scripts. Write meaningful error messages to
custrecord_ord_tran_errorwhen processing fails. - Logging: Use
N/logto maintain audit trails of custom processing activities. - Status Updates: Always update the transaction status after processing — set to
Successon completion orErroron failure. - Documentation: Document your custom processing logic for each transaction type.
- Testing: Test custom processing in a NetSuite sandbox environment before deploying to production.
Updated about 1 month ago
