Alrighty, time to call in the big guns. I’m tryin...
# suitescript
m
Alrighty, time to call in the big guns. I’m trying to retrieve a list of vendor payments on a given vendor bill. Is there a sublist I can loop through or will I need to do a search. I performed a search in the UI and was able to get what I want, however trying to recreate the search in SuiteScript and I’m getting empty values for “applyingtransaction”
Copy code
const paymentsSearch = search.create({
                    type: search.Type.TRANSACTION,
                    columns: [{
                        name: 'applyingtransaction'
                    },
                    {
                        name: 'appliedtotransaction'
                    }, {
                        name: 'internalid'   
                    }
                    ],
                    filters: [{
                        name: 'internalidnumber',
                        operator: search.Operator.EQUALTO,
                        values: newRecID
                    },
                    {
                        name: 'mainline',
                        operator: search.Operator.IS,
                        values: 'T'
                    }]
                });
                log.debug("paymentsSearch", paymentsSearch);
                paymentsSearch.run().each(function(result) {
                    log.debug("result", result);
                    var paymentID = result.getValue({
                        name: 'applyingtransaction'
                    });
                    log.debug("paymentID", paymentID);
                    return true;
                });
m
If you've created a search in the UI you can export it to SuiteScript with this extension https://chrome.google.com/webstore/detail/netsuite-search-export/gglbgdfbkaelbjpjkiepdmfaihdokglp
m
Nice, thanks! I also figured out the issue.. was using the wrong variable for the id :/