In a User Event script I typically get the ID in a...
# suitescript
j
In a User Event script I typically get the ID in afterSubmit by using
scriptContext.newRecord.id
, note this will only work in an After Submit method if the Record is just being created.