Discussions
Join the NetSuite community to innovate, connect, and discover what’s next.
SuiteWorld brings thousands of innovators, builders, and leaders together to learn, connect, and shape what’s next. This October, explore how to build a stronger foundation for growth through inspiring keynotes, major product reveals, hands-on sessions, and unforgettable moments—all in one place for our biggest event of the year. Register now
Update an existing line on record transform
Hi There
I have the following script:
/**
*@NApiVersion 2.x
*@NScriptType MapReduceScript
*/
define(["N/record", "N/search", "N/runtime"], function (
record,
search,
runtime
) {
function getInputData() {
try {
var scriptObj = runtime.getCurrentScript();
var recordId = scriptObj.getParameter("custscript_recordid");
var salesOrderid = recordId;
log.debug("recordid", salesOrderid);
var salesorderSearchObj = search.create({
type: "salesorder",
filters: [
["type", "anyof", "SalesOrd"],
"AND",
["internalid", "anyof", [salesOrderid]],
"AND",
["shipping", "is", "F"],
"AND",
["taxline", "is", "F"],
"AND",
["mainline", "is", "F"],
"AND",
[
"formulanumeric: {quantitypacked}-{quantitybilled}",
"greaterthan",
"0",
],
],
columns: [
search.createColumn({ name: "internalid", label: "Internal ID" }),
search.createColumn({ name: "source", label: "Source" }),
search.createColumn({ name: "salesrep", label: "Sales Rep" }),
search.createColumn({ name: "trandate", label: "Date" }),