Discussions
Join us for complimentary one-day events around the world and step into a future fueled by AI and limitless potential. Explore new breakthroughs, sharpen your skills, and connect with experts who are shaping what’s next. Experience bold keynotes, interactive learning, and connections that span the global NetSuite community. Discover what's next at SuiteConnect Tour 2026.
Weekly TimeSheet client script totalHours not refresh in direct
Hello,
I have a question when i use a client script on time sheet, i use this ==>
var timesheetRecord = scriptContext.currentRecord;
var totalHours = timesheetRecord.getValue('totalhours');
But when i log it this variable totalHours , i don't have the current value but i have the previous save value on the record and not the value in direct.
can i do a refresh in my script for take the good value i direct before save it ?
function saveRecord(scriptContext) {
var timesheetRecord = scriptContext.currentRecord;
var totalHours = timesheetRecord.getValue('totalhours');
log.debug({
title : 'totalHours',
details : totalHours
});
if (Number(totalHours) > 39) {
dialog.alert({
title : 'Alert',
message : 'Le temps total saisie est supérieur de 39'