i have a saved search, it returns value in the UI,...
# suitescript
v
i have a saved search, it returns value in the UI, but in the script it does not return anything. what is wrong?
c
Share your code
v
var amortizationJournal = search.create({ type: "transaction", filters: [ ["amortizationschedule.name","isnotempty",""], "AND", ["amortizationschedule.internalid","anyof","14409"] ], columns: [ search.createColumn({ name: "schedulenumber", join: "amortizationSchedule", label: "Schedule Name" }), search.createColumn({ name: "internalid", join: "amortizationSchedule", label: "AS IntID" }), search.createColumn({name: "type", label: "Type"}), search.createColumn({name: "mainname", label: "Main Line Name"}), search.createColumn({name: "transactionnumber", label: "Transaction Number"}), search.createColumn({name: "tranid", label: "Document Number"}), search.createColumn({name: "memo", label: "Memo"}), search.createColumn({name: "amount", label: "Amount"}), search.createColumn({name: "departmentnohierarchy", label: "Department"}), search.createColumn({name: "classnohierarchy", label: "Class"}), search.createColumn({name: "locationnohierarchy", label: "Location"}), search.createColumn({name: "custcol_cld_trx_project", label: "Project"}), search.createColumn({name: "custcol_cld_profit_centre", label: "Retailer"}) ] }); log.debug('amor',amortizationJournal);
c
Where do you run it?
Is that all of your code?
v
yes
amortizationJournal.run().each(function (result) { log.debug('result',result); });
i dont get both the logs
s
just a word of caution, if you don’t return true at the end of your search iterator, it will stop after one iteration. but if you aren’t getting either log, the code may be breaking in or before the search.create call. what script type is this?
v
its MR script
yes sir its working now. thank you all
the modules are misplaced