CPQ Ecommerce Integration: Background Conversion of Standard Line Items via Scheduled Script
NetSuite CPQ Ecommerce Integration adds a scheduled-script pipeline (CPQE-SC-BCL) that converts standard transaction line items from SuiteCommerce or external ecommerce platforms into CPQ-configured line items in the background, with a postponed-launch fallback via custom record.
What changed
The NetSuite CPQ Ecommerce Integration SuiteApp introduces a server-side pipeline for converting standard line items on transactions (e.g., sales orders originating from SuiteCommerce web stores or third-party ecommerce platforms) into fully configured CPQ line items—without user interaction in the UI. The entire flow is driven by a scheduled script and runs through four sequential phases on the server.
Core scheduled script
The processing engine is CPQE-SC-BCL (customscript_cpqe_sc_bcl), a scheduled script that accepts these parameters:
custscript_cpqe_scf_productid– Internal ID of the CPQ Configurator product (found under CPQ > Configurator > Product Maintenance).custscript_cpqe_scf_rectype– Transaction record type (e.g.,salesorder).custscript_cpqe_scf_oid– Transaction internal ID.custscript_cpqe_scf_nosub– Boolean; whentrue, skips submitting the updated transaction. Default:false.custscript_cpqe_scf_custparams– JSON-stringified object of custom parameters, retrievable in actions viagetValue('SOLE', 'LAUNCH_PARAMETERS')orgetLaunchParameter('paramName'). These values are session-scoped and not persisted to the configuration record.
Processing phases (executed once per launch)
- Run before-event actions (ordered by sequence number).
- Refresh building blocks (ordered by sequence number).
- Run after-event actions (ordered by sequence number).
- Submit configuration: creates the configuration record, adds configured items to the transaction, and saves the transaction.
Launching the script
You launch customscript_cpqe_sc_bcl from any SuiteScript 2.x server-side script type: User Event, Suitelet, RESTlet, or Scheduled Script, using N/task.create() with taskType: task.TaskType.SCHEDULED_SCRIPT. The most common pattern is an afterSubmit user event that checks a custom condition, launches the scheduled script, and resets the condition to prevent re-processing on subsequent edits.
Postponed launch fallback
If the task queue rejects the direct launch (e.g., concurrency limits), the script should create a CPQE-BC-Launch-Request custom record (customrecord_cpqe_bc_lrequest) with these fields:
custrecord_cpqe_bc_lrequest_prodidcustrecord_cpqe_bc_lrequest_rec_typecustrecord_cpqe_bc_lrequest_order_idcustrecord_cpqe_bc_lrequest_custparams
A companion scheduled script, CPQE-SC-ScanBCLTasks, runs every 15 minutes, picks up postponed launch records, re-attempts the launch, and deletes successfully processed records.
Action constraints vs. standard CPQ Configurator
- JavaScript ES5 only – ES6 syntax is not supported in CPQ Ecommerce Integration actions.
- All actions run server-side – there is no client/server distinction. Do not use browser/DOM APIs.
- To share a product between CPQ Configurator (UI) and CPQ Ecommerce Integration (background), isolate browser-dependent code in separate actions and gate them with the predefined answer
X(SOLE/BC)in the Rule field. The action fires only when launched by Ecommerce Integration.
Unsupported capabilities
The following CPQ Configurator features are not available in CPQ Ecommerce Integration:
- Item creation records and creation records.
- Setting transaction fields via mapping records.
- SuiteQL table searches inside actions.
- Sourcing prices from materials.
- Displaying additional item prices in the Summary.
What to do
- Install the prerequisite: Ensure the NetSuite CPQ Configurator SuiteApp is installed before enabling CPQ Ecommerce Integration.
- Build a CPQ Configurator product with building blocks (materials, routing steps) and actions that generate a configuration from transaction line items. Write all action code in ES5.
- Gate browser-specific actions: If you share products between the Configurator UI and Ecommerce Integration, add
X(SOLE/BC)as a rule on any action containing client-side DOM code so it only executes in the background pipeline. - Write a launch script (typically a User Event
afterSubmit) that:- Checks a custom condition to decide whether to process the transaction.
- Calls
N/task.create()withscriptId: 'customscript_cpqe_sc_bcl'and the required params. - Resets the custom condition after a successful queue to prevent duplicate processing.
- Falls back to creating a
customrecord_cpqe_bc_lrequestrecord if the direct launch fails.
- Deploy the launch script on the target transaction record type (e.g., Sales Order) via the script’s Deployments sublist.
- Test with the debugging tool referenced in Oracle’s docs (Testing and Debugging the Conversion into Configured Items) to verify your product configuration before going live.
- Monitor governance: Because CPQE-SC-BCL is a scheduled script, be aware of the 10,000 governance-unit limit per execution. Complex products with many building blocks or actions may need optimization. Also monitor the CPQE-SC-ScanBCLTasks script for postponed launch record backlogs.
Technical notes
- The release version for this feature is not explicitly stated in the source documentation. Verify availability in your account’s SuiteApp marketplace or check the CPQ bundle version.
- Custom launch parameters passed via
custscript_cpqe_scf_custparamsare ephemeral—they exist only for the duration of the configuration session and are not saved to the configuration record. - The
getLaunchParameter()helper returnsundefinedfor nonexistent keys; guard accordingly in your action code.
Source: Oracle NetSuite Release Notes