Alan Fitch
03/10/2021, 3:22 PMfunction beforeSubmit(context){
const purchprice = context.newRecord.getValue('cost');
const purchconversionrate = context.newRecord.getValue("purchaseconversionrate")
const priceum = Math.round(purchprice / purchconversionrate)
log.debug("priceum",priceum)
context.newRecord.setValue({
fieldId: "custitempriceperconsumptionum",
value: priceum
})
log.debug("rec",context.newRecord)
}
I can see it's running and the second log returns the record with the value set but the changes aren't being saved on the item.Sandii
03/10/2021, 3:25 PMAlan Fitch
03/10/2021, 3:34 PM