Try adding your converted code below to the end of the following embed
! Start of "On Update : Form begins"
! [Priority 5000]
Access:POTRN.UseFile()
If Access:POTRN.Insert()
Message('Unable to Insert POTRN')
End
p_web.filetosessionqueue(potrn,net:alsovaluequeue)
ans = net:ChangeRecord
p_web.SetSessionValue('FormNewDraftPO:Primed',1)