So when you want to edit a record in the afterSubm...
# suitescript
j
So when you want to edit a record in the afterSubmit function you need to load the record rather than just using scriptContext.newRecord, you could do this by doing
newRecord = record.load({type: record.Type.SALES_ORDER, id: scriptContext.newRecord.id});
if that makes sense?