Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
Getting sitecategory name in scheduled script
I’m trying to implement a way of cross selling into our product pages.
IE: having a list of other categories the item is in listed on the product page with links to these categories.
At first I wrote a script which was ran each time an item was opened and then saved:
for ( var i = 1; i <= nlapiGetLineItemCount('sitecategory'); i++ )
{
text = nlapiGetLineItemText('sitecategory', 'category', i);
strCategories += text.replace("'", "\\'");
if( i != nlapiGetLineItemCount('sitecategory') )
strCategories += ' | ';
}
this got me a list of categories the item is in like 'Cat : Sub Cat 1 | cat2 : sub cat2'
This was becoming unmanagable and so i decided to make it a scheduled script, the problem is the same code returns for example '1075 | 57734'.