This topic contains 5 replies, has 0 voices, and was last updated by dominicb 8 years ago.

  • Author
    Posts
  • #5996

    dominicb

    Can anyone advise the current situation with searching for a list of web site categories using Suitescript? I understand that this was functionality missing in earlier releases, but I find Netsuite’s documentation of new features a bit hard to fathom and am unsure whether this is something which is now possible. All I’m after at the moment is a list of Website:CategoryId attributes.

    I’m currently using SiteCategorySearch() in the PHP toolkit with Suitetalk, but speed is proving an issue.
    This is a cached copy. Click here to see the original post.

  • #5997

    robert.paulson

    Hi,

    Be warned that the following is not documented and most probably not officially supported. Hence this can stop working at any point and time.

    It is possible to run a search using the id ‘sitecategory’.

    i.e

    var columns = [new nlobjSearchColumn(‘name’)]

    var results= nlapiSearchRecord(‘sitecategory’,null,null,columns );

    Hope that helps

    Bob

  • #5998

    dominicb

    Thanks Bob. Do you know if it’s possible to filter the results with the website value? Or am I going to have to search category internalIds separately to get the site name/ID they belong to?

  • #5999

    fourthwaveconsulting

    Many of the fields on the category record aren’t available in a search, scripted or not. Most of the time, if you can’t add the field in the criteria or results when creating a search in the UI, then you can’t do it in SuiteScript either. I have written a number of scripts dealing with categories, and I pretty much have to load the category record to get most of the useful information.

  • #6000

    chanarbon

    For this concern, what fields from the sitecategory would you like to search? Have you tried to get the similar fields that are available on SiteCategorySearchBasic? You just need to lowercase the ids.

  • #6001

    dominicb

    All sorted now. In the end, I had to pull the category list, loop through the results, discard the records which didn’t match my criteria, then use nlapiLoadRecord to get the missing website field. Just annoying that I’ve had to do things that way, as it increases script execution time tenfold.

You must be logged in to reply to this topic.