function get_files(context, rec) { var file...
# suitescript
k
function get_files(context, rec) { var files = []; var filters = [ ["internalidnumber", "equalto", rec.id], "AND", ["file.internalidnumber", "isnotempty", ""] ]; var cols = [ search.createColumn({ name: "internalid", join: "file" })]; var file_search = search.create({ type: "customrecord_mf_mi", filters: filters, columns: cols }); file_search.run().each(function(result){ try { files.push(file.load({id: result.getValue(cols[0])})); } catch(ex) { log.error("Could not attach file to " + rec.id, ex); } return true; }); return files; }
f
hey, thanks for the reply. I thought about searching for the file, but this would be on creation so the transaction wouldn;t have an ID to match yet.