jen
08/28/2026, 4:37 PMcustomrecord_wssched and customrecord_wssched_item
customrecord_wssched_item is a child record of customrecord_wssched
The sublist id of the children on the parent is recmachcustrecord_wssched_item_wssched
I am trying to write a script to remove all children from the parent. I’m loading the parent, and working backwards from the end of the sublist, I am removing each child one by one using record.removeLine(). Then I save my parent record.
The issue is that the children are not removed, and I am not sure why. Any suggestions? Here is my code:
let sublist_id = 'recmachcustrecord_wssched_item_wssched';
let wssched = record.load({type: 'customrecord_wssched', id: wssched_id, isDynamic: true});
// Reports that there are 470 lines
log.debug({title: 'before removing lines', details: 'linecount is ' + wssched.getLineCount({sublistId: sublist_id})});
for(var si = wssched.getLineCount({sublistId: sublist_id}) - 1; si >= 0; si--)
wssched.removeLine({sublistId: sublist_id, line: si, ignoreRecalc: true});
// Reports that there are 0 lines
log.debug({title: 'after removing lines', details: 'linecount is ' + wssched.getLineCount({sublistId: sublist_id})});
wssched.save();
// Reports that there are 0 lines
log.debug({title: 'after saving', details: 'linecount is ' + wssched.getLineCount({sublistId: sublist_id})});
// Load the record again.
wssched = record.load({type: 'customrecord_wssched', id: wssched_id, isDynamic: true});
// Reports that there are 470 lines
log.debug({title: 'after reloading', details: 'linecount is ' + wssched.getLineCount({sublistId: sublist_id})});Geo
08/28/2026, 5:05 PMjen
08/28/2026, 5:20 PMjen
08/28/2026, 5:20 PMjen
08/28/2026, 5:21 PMEdgar Valdes
08/28/2026, 5:26 PMjen
08/28/2026, 5:28 PMGeo
08/28/2026, 5:28 PMjen
08/28/2026, 5:28 PMEdgar Valdes
08/28/2026, 5:38 PMMe: NetSuite, please save this change
NS: Sure!
Me: Is it saved?
NS: Yes!
Me: It didn't change anything
NS: Obv no 🙂
Me: Why?
NS: ...
creece
08/28/2026, 5:43 PMjen
08/28/2026, 5:45 PMcreece
08/28/2026, 5:48 PMChristopher Quackenbush
08/28/2026, 5:58 PMJamie Houselog
08/28/2026, 6:57 PMericl
08/28/2026, 8:38 PMcreece
08/29/2026, 2:15 AMSimonC
08/29/2026, 6:04 AM