startConfig()
The startConfig() function opens the configuration interface for the specified product using the provided information. This function builds a URL based on the product identifier (either code or internal ID). The product can be opened in a new tab, the current window, or a popup window. You can includes additional data and URL parameter.
Syntax
Use this syntax for the startConfig() function:
startConfig({
id: number, // Use id OR code
code: string,
target: 'self' | 'tab' | 'window',
data: any,
params: {
paramName1: string | number,
paramName2: string | number,
paramName3: string | number
}
});
Return Value
If the provided parameters are incomplete or the product can't be found, the startConfig() function returns false. Otherwise, the functions opens the specified product interface and returns undefined.
Parameters
Either the code or id property is required.
The startConfig() function accepts an object as a parameter. This object includes the following properties:
-
id- Specifies the internal ID of the product you want to open. You can find the ID in the ID field on the product record. If provided, this property takes priority overcode. -
code- Specifies the code of the product to open. You can find the code in the Code field on the product record. Ifidisn't provided, this property resolves to an internal NetSuite ID. -
target- Determines where the product interface opens. This property can take one of the following values:-
tab- Opens the product in a new browser tab. This is the default value. -
self- Opens the product in the current window. -
window- Opens the product in a popup window.
-
-
params- An object containing additional query string parameters to append to the product URL. -
data- An object representing initial form data available in the product configuration.
Examples
The following examples show how to use the startConfig() function.
Opening a Product in a New Tab with a Custom Parameter
This example opens a product using its code. The product interface opens in a new browser tab and pass a custom URL parameter.
startConfig({
code: 'CPQ001',
target: 'tab',
params: { customParam: 'abc123' }
});
Opening a Product in a Popup Window
This example opens a product using its internal ID. The product interface opens in a popup window, and the quantity is provided as initial data to prefill the configuration.
startConfig({
id: 24531,
target: 'window',
data: { quantity: 5 }
});