you could do a line init and if there isn't a line...
# suitescript
c
you could do a line init and if there isn't a lineid on that line then it hasn't been created yet and you can clear that custom record field