Marty Zigman

Conversations with Marty Zigman

Certified Administrator • ERP • SuiteCloud

Marty Zigman LinkedIn

Marty Zigman

Holding all three official certifications, Marty is regarded as the top NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc.. He is a former Deloitte & Touche CPA and has held CTO roles. For over 30 years, Marty has produced leadership in ERP, CRM, and eCommerce business systems. Contact Marty to set up a conversation.

BiographyYouTubeLinkedInX (Twitter)

21 thoughts on “NetSuite SuiteScript 2.0 Search Join and Summary Example

  1. The query rendered seems to implicitly execute an INNER JOIN. Is there a way to do a LEFT JOIN as well? For example, if I wanted to get a list of customers along with the name of their parent customer, I would join through the parentcustomer relationship. However, an inner join would omit customers that do not have a parent, so a left join would be preferable.

  2. JSON.parse(JSON.stringify(roleList)) — Does this works ? For me it gives error.
    Assume that your rolelist as
    roleList = {“internalid”:”1234″}.

    org.mozilla.javascript.EcmaError: TypeError: Cannot find function _marshal in object [object Object]

  3. When I use this code I get a error.

    var roleList = {internalid:14627};
    var x = JSON.parse(JSON.stringify(roleList))

    TypeError: Cannot find function _marshal in object [object Object]

    I asked you this question here becos I was trying to use IN like query in the filter. I have multiple ids to be choose.

    Now the question is how do you find the “join: ‘role'” from “employee” record. I am referring to the current 2017 record browser and not able to find any join in name of role.
    TIA

  4. Hi Marty,

    Do you have any recent information on SuiteQL and Multi Join capabilities?

    Kind Regards,
    Viktor

  5. Hi Marty,

    I have a SuiteScript 2.0 that load and search transaction saved search with posting period filter. In my filter I am using ‘anyof’ operator which is not working for ‘postingperiod’ field

    below is sample of my code:

    function getTransactionData(datain)
    {
    try
    {

    var objSearch = search.load(
    {
    id: datain.savedsearchid
    });

    objSearch.filters.push(search.createFilter({ name: “postingperiod”, operator: “ANYOF”, values: [“42”, “43”]}));
    //above filter filters only record with internalid 42
    result = readAllData(objSearch);
    return result;
    }
    catch (ex)
    {
    log.error(“getTransactionData”, ex);
    throw ex;
    }
    }

    Please note above issue is occurring only for saved search and even in saved search only for postingperiod field, if I search other object for example ‘account’ object with internalid filter using ‘anyof’ operator, works fine.

    can you please suggest me some solution for the same.

    Thank you very much.

  6. Hi Marty,

    Thank you so much for looking into this.

    Yes, I have tried with quotes also.

    Yes it works for one value, but when I pass multiple value is in an array, anyof filters only for first value of array.

    Yes these are internalids. In my Netsuite account 42 is an internalid of ‘May 2003’ and 43 is an internalid of ‘June 2003’

    Thank you

  7. Hi Marty,

    Thanks for article link. I looked into link but in this script ‘anyof’ not been used with ‘postingperiod’ field anywhere. As I mentioned in my query, this issue is only for ‘postingperiod’ field. If I use ‘anyof’ operator with other fields of transaction saved search (for example I create filter for account field using ‘anyof’ operator) it works fine.

    Thanks

  8. Hi Marty,

    This works like a charm.

    Thank you so much…
    Thank you so much…
    Thank you so much…

    Regards:
    Umesh

  9. Hi Marty. Your articles are probably the most informative NetSuite articles I’m aware of, so I’m hoping maybe you can answer a question I haven’t been able to find a definitive answer to. If I set the sort on a single column in a search, and then run that search as a paged search, should it sort the entire dataset by that column? Or should it just sort each page by the specified column?

    For example, I’m running a transaction search that returns a couple thousand records. One of the columns is “balance”, which joins on customer. I want to sort the entire dataset by that column, and then give me the results in pages of 100. But NetSuite seems to only sort each individual page by the customer’s balance, and not the entire dataset. Is what I’m trying to accomplish even possible? Any info would be appreciated.

    Thanks,

Leave a Reply

Your email address will not be published. Required fields are marked *