Marwan
05/24/2022, 10:58 AMline
field, select that, get the info I want, then mark it as synced. But in this case, I actually end up selecting the next line...battk
05/24/2022, 11:03 AMMarwan
05/24/2022, 11:10 AM// fetch the lines
var src = search.create({
type: "journalentry",
columns: ["line", "entity", "memo", "amount"],
filters: [
search.createFilter({
name: "internalid",
operator: <http://search.Operator.IS|search.Operator.IS>,
values: journalID,
}),
search.createFilter({
name: "custcol_edc_journal_line_synced",
operator: <http://search.Operator.IS|search.Operator.IS>,
values: false,
}),
search.createFilter({
name: "debitamount",
operator: search.Operator.ISNOTEMPTY,
values: false,
}),
],
});
var lines = src.run().getRange({ start: 0, end: 50 });
Then, loop over the lines, first get the value of line
select that line, get the values, and mark it as synced and commit
let lineNum = lines[i].getValue("line");
journal.selectLine({
sublistId: "line",
line: lineNum,
});
payload["amount"] = Math.abs(
journal.getCurrentSublistValue({
sublistId: "line",
fieldId: "debit",
})
);
journal.setCurrentSublistValue({
sublistId: "line",
fieldId: "custcol_edc_journal_line_synced",
value: true,
ignoreFieldChange: true,
});
journal.commitLine({
sublistId: "line",
});
battk
05/24/2022, 11:14 AMbattk
05/24/2022, 11:15 AMMarwan
05/24/2022, 11:15 AMbattk
05/24/2022, 11:16 AMbattk
05/24/2022, 11:16 AMbattk
05/24/2022, 11:17 AMMarwan
05/24/2022, 11:20 AMuse Record.findSublistLineWithValue instead to find the matching lineThat would require having a unique value for each line, right?
battk
05/24/2022, 11:21 AMMarwan
05/24/2022, 11:22 AMMarwan
05/24/2022, 11:24 AMMarwan
05/24/2022, 11:24 AM