SuiteTalk Advanced Search Examples

Viewed 4737

I've only worked with NetSuite and SuiteTalk for less than one year. I've found examples of basic searches and advanced searches that leverage saved searches, but I had a hard time finding examples of how to perform an advanced search from scratch with criteria and selected columns in the result set. So I'm asking for examples.

3 Answers

I came back to this code a year later. I was coding another advanced search and thought perhaps it was unnecessary to add a blank element to the array definitions. THAT WAS A MISTAKE. It is absolutely necessary! If you omit these, the search works, but returns nothing but nulls for SearchResult.basic and SearchResult.ItemJoin.

            TransactionSearchAdvanced advanced = new TransactionSearchAdvanced()
            {
                columns = new TransactionSearchRow()
                {
                    basic = new TransactionSearchRowBasic()
                    {

                        // new SearchColumnSelectField() is required!!!!!!
                        internalId = new SearchColumnSelectField[] { new SearchColumnSelectField() } 

                    }
                    ,
                    itemJoin = new ItemSearchRowBasic()
                    {

                        // new SearchColumnSelectField() is required!!!!!!
                        externalId = new SearchColumnSelectField[] { new SearchColumnSelectField() } 

                    }

                }
}
Related