This topic contains 2 replies, has 0 voices, and was last updated by jshepler 6 years, 7 months ago.

  • Author
    Posts
  • #18070

    jshepler

    I’m trying to run a search for open creditmemos on a billing account, but I’m getting 3 rows per record and I don’t know why.

    I’ve simplified the search and put it in a restlet that I call from postman. The billing account I’m using to test with has a single credit memo, but 3 rows are returned from the search with the same id:

    Code:
    var billingAccountFilter = search.createFilter({ name: “billingaccount”, operator: search.Operator.IS, values: “512” });
    var openCreditsSearch = search.create({ type: search.Type.CREDIT_MEMO, filters: [billingAccountFilter]});
    var results = openCreditsSearch.run().getRange(0, 1000);

    return results;

    [
    {
    “recordType”: “creditmemo”,
    “id”: “2784”,
    “values”: {}
    },
    {
    “recordType”: “creditmemo”,
    “id”: “2784”,
    “values”: {}
    },
    {
    “recordType”: “creditmemo”,
    “id”: “2784”,
    “values”: {}
    }
    ]

    Am I missing something?
    This is a cached copy. Click here to see the original post.

  • #18071

    rbigej

    You need to add a mainline filter, otherwise NetSuite will return the Line Items.

    [[‘mainline’, search.Operator.IS, ‘T’],

  • #18072

    jshepler

    That worked, thanks!

You must be logged in to reply to this topic.