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

  • Author
    Posts
  • #21801

    FHC

    I've got a programatic search I'm trying to run using the following as the basis for the code:

    Code:
    columns = new Array();
    columns[0] = new nlobjSearchColumn('itemid');
    columns[1] = new nlobjSearchColumn('internalid');
    columns[2] = new nlobjSearchColumn('urlcomponent');
    columns[3] = new nlobjSearchColumn('categorypreferred');
    columns[4] = new nlobjSearchColumn('storedisplayname');
    columns[5] = new nlobjSearchColumn('displayname');
    columns[6] = new nlobjSearchColumn('parent');
    columns[7] = new nlobjSearchColumn('matrix');

    columns[0].setSort();

    filters = [
    ["type","anyof","InvtPart"],
    "AND",
    ["isonline","is","T"],
    "AND",
    ["isinactive","is","F"],
    "AND",
    ["website","anyof","2"]
    ]

    results = nlapiSearchRecord('inventoryitem', null, filters, columns);
    I need to be able to sort by itemid because I need to group the items together by matrix items. But, the results that are returned in the itemid column via nlapiSearchRecord are not the same ones I get when I just execute the search in Netsuite. When I run the search in Netsuite, I can see an itemid like this:Item Name-Black-S
    Item Name-Black-L
    (with extra data representing their matrix options.). When I execute the code above, all that comes back is:Item Name
    Item Name
    What gives? Why are they different?
    This is a cached copy. Click here to see the original post.

  • #21802

    david.smith

    Try using this: https://chrome.google.com/webstore/d…epdmfaihdokglp

  • #21803

    FHC

    And even when I create a saved search and edit all the parameters through the saved search, the itemid doesn't return correctly.

    results = nlapiSearchRecord('item', 'customsearch_searchid, null, null);

  • #21804

    FHC

    Thanks, David. Your plugin is exactly what I used to get my filters and columns setup. In all cases, the itemid doesn't return the full string.

  • #21805

    david.smith

    Hmmm, I'm not sure. That seems weird.

  • #21806

    FHC

    I actually ended up figuring out why it was doing this. Under the advisement of one of the fine folks in these forums (@david.smith), I’ve been executing the script as a custom role called “External Scripts Only” which has a bare minimum of user permissions (some access to custom records and items > View under Permissions > Lists). I changed the script to run as Administrator and was able to receive the full itemid. However, I don't know why there would be a difference between the two or if there are some permissions I could add to my custom user role that would return the full itemid… (Items > Full doesn’t work)

You must be logged in to reply to this topic.