Slig
11/05/2021, 8:07 PMvar currentRecord = context.newRecord;
var transactionRec = record.load({
type: currentRecord.type,
id: currentRecord.id
});
var terms = transactionRec.getValue({
fieldId: 'duenextmonthifwithindays'
})
var fluxoDataPrevista = transactionRec.getValue({
fieldId: 'custrecord_gf_data_prevista'
})
var data = new Date(dataEntrega)
var formatDate = format.format({
value: data,
type: format.Type.DATE
})
var dataEntrega = transactionRec.getValue({
fieldId: 'duedate'
})
if (context.type === context.UserEventType.EDIT) {
if (fluxoDataPrevista === '') {
currentRecord.setValue({
fieldId: 'duedate',
value: formatDate.setDate(formatDate.getDate() + getDay(90))
})
}
}
jen
11/05/2021, 8:09 PMData cannot be manipulated for records that are loaded in beforeLoad scripts. If you attempt to update a record loaded in beforeLoad, the logic is ignored.
CD
11/05/2021, 8:15 PMbattk
11/05/2021, 10:31 PMbattk
11/05/2021, 10:33 PMvar data = new Date(dataEntrega)
is wrong since it uses dataEntrega
before its given a valuebattk
11/05/2021, 10:34 PMbattk
11/05/2021, 10:36 PMbattk
11/05/2021, 10:36 PMbattk
11/05/2021, 10:37 PMbattk
11/05/2021, 10:37 PMbattk
11/05/2021, 10:39 PMbattk
11/05/2021, 10:39 PMbattk
11/05/2021, 10:40 PMjen
11/08/2021, 4:32 PMdataEntrega
hasn’t been given a value earlier in the script?jen
11/08/2021, 4:32 PMbattk
11/08/2021, 6:57 PMformatDate.setDate
doesnt throw an error is if data
isn't a Datebattk
11/08/2021, 6:58 PMformat.format
is a stringSlig
11/09/2021, 1:23 PMSlig
11/09/2021, 1:23 PMSlig
11/09/2021, 1:25 PMbattk
11/09/2021, 1:27 PMbattk
11/09/2021, 1:27 PMSlig
11/09/2021, 1:27 PMSlig
11/09/2021, 1:35 PMbattk
11/09/2021, 1:44 PMbattk
11/09/2021, 1:44 PMbattk
11/09/2021, 1:46 PMbattk
11/09/2021, 1:47 PMbattk
11/09/2021, 1:48 PMSlig
11/09/2021, 2:28 PM