Discussions
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
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'