Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
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'.