2
votes

I am very new to SuiteScript so I might be posting a lot of questions out here and hope you can all help.

My first question is why is my saved search not passing values on my MapReduce script? My code is below.

function getInputData() {
        try{
            log.debug("Get Input", "Initiated");
            //Customer Search
            var customerSearch = search.load({
                id: 'customsearch_brad_itemprice'
            });

            log.debug("customerSearch", customerSearch);
            log.debug("GetInputData", "Completed");

            return [customerSearch];
        }catch(exception){
            log.debug("GetInputDate Error Message:",exception);
        }
    }

Here is an image of the debug log that shows the variables are null.

Suitescript 2.0 Debug Log:

enter image description here

Your insights are greatly appreciated!

Brad

1
Welcome to the SuiteScript community! Here are some resources to get you started: 1) Free NetSuite Professionals Slack community: netsuiteprofessionals.com 2) Stack Overflow Docs section: stackoverflow.com/documentation/netsuite/topics 3) Free email course with more great resources: learnsuitescript.com - erictgrubaugh

1 Answers

3
votes

You are returning an array of searches. You need to return a search object

Change this:

return [customerSearch];

to this:

return customerSearch;