NElliott
11/03/2021, 11:23 AMvar lineCount = rec.getLineCount({sublistId:"custpage_item_sublist"})||-1;
if(lineCount>0){
var prevItem = rec.getSublistValue({sublistId:"custpage_item_sublist",fieldId:'item',line:(lineCount-1)})||'';
console.table({"lineCount":lineCount, "item":prevItem});
if(prevItem !==''){
rec.setCurrentSublistValue({sublistId:'custpage_item_sublist',fieldId:'item',value:prevItem,ignoreFieldChange:true});
console.log("set");
}
}
(I see the table data and also the "set" in the console.)
I've tried to manually set the column with a completely different value hardcoded, thinking maybe the current selected line is perhaps still the previous for some weird reason but still no change. (I've tried with ignoreFieldChange true and false in case fieldchange was tripping things up)
I've also tried this in sublistChange when the line is committed, same result.