So, im setting a customfield based on the value of...
# suitescript
i
So, im setting a customfield based on the value of a multiple select field on an user event
beforeSubmit
, this works correctly, except when another script calls a
submitField
for the record, when this happens, for some reason the
oldRecord
value contains the correct value, but the
newRecord
is zero, so this is doing that whenever the submitields run, it sets the value of the calculated field to zero, I tried sending the value of the multiple select on the submitFields call to set it, and this shows the newRecord value as it should be but as the script that does the submitFields is not mine, I cant modify it, any idea what could i do?
a
You may need to move your logic to afterSubmit for this one, not ideal, not pretty, but sometimes the only option.
b
the submitFields is an xedit
xedits only have the new field values on the newRecord
🙌 1
i
I was trying to avoid that, but yeah, I think ill do a lookup and submitFields on the afterSubmit
Becuase as battk says, its the same issue on afterSubnmit on newRecord, its empty
b
if your field is not present on the newRecord, then its value has not changed
i
Fixed it, its not pretty but it works! Thank you both!