In some cases, Item records may be missing key details such as a Description or Sales Description. This can cause confusion for end users, reporting gaps, or incomplete information on transactions and printed forms.
As an Administrator, you can use SuiteScript to quickly identify which Items have blank or missing descriptions. Automating this check makes it much easier to review and clean up data, ensuring that all Items are properly documented.
Here’s a simple Suitelet script that searches for items where the description or sales description is blank:
/**
* @NApiVersion 2 .x
* @NScriptType Suitelet
*/
define(['N/search','N/record'], function(search,record) {
function onRequest(scriptContext) {
var itemSearch = search.create({
type: search.Type.ITEM,
filters: [
['salesdescription', search.Operator.IS, ''],
'or',
['description', search.Operator.IS, '']// Description is NULL/Empty
],
columns: [
'internalid',
'itemid'
]
});
var results = itemSearch.run().getRange({ start: 0, end: 100 });
results.forEach(function(res) {
log.debug('Items with Null Description', 'Item ID: '+ res.getValue('internalid')+' | '+
'Item: '+ res.getValue('itemid'))
});
}
return {
onRequest: onRequest
};
});
- The script uses a search on the Item record type.
- It applies filters to check whether the description or sales description field is empty.
- The results are logged, showing the internal ID and item name/number for each item missing these values.
The sample code described herein is provided on an "as is" basis, without warranty of any kind, to the fullest extent permitted by law. Oracle + NetSuite Inc. does not warrant or guarantee the individual success developers may have in implementing the sample code on their development platforms or in using their own Web server configurations.
Oracle + NetSuite Inc. does not warrant, guarantee or make any representations regarding the use, results of use, accuracy, timeliness or completeness of any data or information relating to the sample code. Oracle + NetSuite Inc. disclaims all warranties, express or implied, and in particular, disclaims all warranties of merchantability, fitness for a particular purpose, and warranties related to the code, or any service or software related thereto.
Oracle + NetSuite Inc. shall not be liable for any direct, indirect or consequential damages or costs of any type arising out of any action taken by you or others related to the sample code.
To know more about deploying SuiteScript, check these New to NetSuite Articles.
Do you have another way on how to automate your transactions using SuiteScript? Feel free to share them here!