Working with Product Configurations
The product configuration gathers the selections made by users for a specific configurable item. Configurations are stored on the configuration record. Any user with advanced permissions can view the configuration record and its ID. To do this, click the Access Config Record button on the configured item line on transactions. To set role permissions, go to the Access subtab on the employee record. Then, select Advanced in the Extended Role Privileges field.
You can also view the configuration ID directly on the transaction. In the Configurator Data line field, look for the value of the configId parameter.
The configuration record stores the configuration in compressed format. You can use a RESTlet endpoint to retrieve the compressed configuration through custom client and server scripts. After taking the configuration ID as a parameter, the endpoint searches for it and returns the decompressed configuration in string format. Then, you can convert it into a JSON object if needed.
In client scripts, use the _nHttps.post() method from the N/https module. This is the syntax:
const response = _nHttps.post({
url: _nUrl.resolveScript({
scriptId: 'customscript_cpqc_rs_maint',
deploymentId: 'customdeploy_cpqc_rs_maint'
}),
body: {
task: 'getConfiguration',
configurationId: id_number
}
});
See the following example:
const response = _nHttps.post({
url: _nUrl.resolveScript({
scriptId: 'customscript_cpqc_rs_maint',
deploymentId: 'customdeploy_cpqc_rs_maint'
}),
body: {
task: 'getConfiguration',
configurationId: 501
}
});
console.log('Parsed configuration: ', JSON.parse(response.body));
In server scripts, use the _nHttps.requestRestlet() method from the N/https module. This is the syntax:
const response = _nHttps.requestRestlet({
scriptId: 'customscript_cpqc_rs_maint',
deploymentId: 'customdeploy_cpqc_rs_maint',
method: 'POST',
body: {
task: 'getConfiguration',
configurationId: id_number
}
});
See the following example:
const response = _nHttps.requestRestlet({
scriptId: 'customscript_cpqc_rs_maint',
deploymentId: 'customdeploy_cpqc_rs_maint',
method: 'POST',
body: {
task: 'getConfiguration',
configurationId: 501
}
});
console.log('Parsed configuration: ', JSON.parse(response.body));
Related Topics
- NetSuite CPQ Configurator Products
- Working with the Product User Interface
- Calculating the Final Pricing for the Configurable Item
- Including Additional Items Related to the Configurable Item
- Creating Work Orders for Configured Items
- Creating Items Required by the Configuration
- Setting Transaction Body and Line Fields Based on Configuration Data