by doing the following in validateLine function I can get all the sublist value id's:
log.debug('Total time: ', timesheet.getSublistFields({
sublistId: sublistName,
}))
["_sequence","_id","approvalstatus","billed0","billed1","billed2","billed3","billed4","billed5","billed6","cseg_progplat","cseg_progplat_display","editable","employeesub","hassupervisor","hours1","hourstotal","id","importedline","internalemployee","isbillable","isbillableenabled","isexempt","isproductive","isutilized","lastselectedbillable","linechanged","overriderate","posted0","posted1","posted2","posted3","posted4","posted5","posted6","statushours1","supervisorapproval","timebill1","timemodified","timetype","sys_id","sys_parentid","customer","rate","department","class","cseg_studynum","memo","custcol_bdo_line_memo","cseg_iteos_cs","cseg_iteos_cs_2","custcol_max_hours","item","casetaskevent","timebill0","statushours0","timebill2","statushours2","timebill3","statushours3","timebill4","statushours4","timebill5","statushours5","timebill6","statushours6","linechanged0","linechanged1","linechanged2","linechanged3","linechanged4","linechanged5","linechanged6","projecttaskassignment","hours0","memo0","memo1","hours2","memo2","hours3","memo3","hours4","memo4","hours5","memo5","hours6","memo6","BY_DAY_NUM_HOURS","BY_DAY_ID","BY_DAY_STATUS","BY_DAY_dayNum","BY_DAY_BILLED","BY_DAY_POSTED","BY_DAY_CHARGED","BY_DAY_TYPE","BY_DAY_memo"]
However when logging them all out I can only get the amount of submitted hours (so after the whole timesheet record is saved). For example:
log.debug('test field6: ', timesheet.getSublistValue({
sublistId: sublistName,
fieldId: 'hourstotal',
line: 0
}))
will return the total hours that appear when the timesheet record is saved and not those that are currently written down in the timesheet.