Listing Items in Commerce Categories

I went looking for a way to list an item’s display name in a hierarchy of full commerce category paths. Unfortunately, It is not possible in native NetSuite. Read the NetSuite forum article here. So here’s my solution. It involves a lot of code. However, with lots of categories and products, it is immensely necessary to keep track of where products live in the site. It will be nice when NetSuite deprecates my work by adding this functionality to native NetSuite.

It is my understanding that SuiteCommerce is a purchased product by NetSuite. They are working feverishly to fully integrate it with NetSuite. So SuiteTalk is somewhat lacking in crossing over the boundary. If you want to blur the lines, you need to use SuiteScript.

So, I did not use SuiteTalk to handle this task. For the record, SuiteTalk will let you download a saved search of all commerce categories. However, you cannot see the associated items and the category hierarchy is pretty cryptic,  something like this… |1|4|5|

What I wanted was something like this…

[category 1 name]:[category 2 name ]:[item display name]

With data in this format, I could feed a Treeview control which would allow our site administrator to browse through items just like they appear in our SCA’s site menu. The real need was using CSV import to assign lots of products to categories. The SMT tools are great for small numbers of products, but not so good for 100s of items.

So, I started with a RESTlet. Here’s what that looks like. getCommerceCategory simply returns the full record for a requested commerce category. getCommerceCategoryProducts returns a list of products under a requested category. I’m not showing getCommerceCategories. It was pretty lengthy and involved returning the results of a saved search against all commerce categories. Too much for this post.

restlet

Then I called my RESTlet from a C# console app that runs nightly. Here’s what that looks like.

calling program

That’s pretty much it. Happy computing!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s