Get(RecordOpenState) will return 1 for an new record that hasn't been committed yet.
• 0 for a closed (committed) record
• 1 for a new record that hasn’t been committed
• 2 for a modified record that hasn’t been committed
If you use onRecordLoad, a newly created record will show 1. If you use onRecordCommit, you can check whether this is the first time the record is being committed. (The advantage of the latter is if you want to incorporate anything besides the auto-entered values for new records, like the primary key, plus you may avoid wasting some time in case the user reverts.)
You might use a field.
Then set this field to 1 at the end of your triggered script
And at the beginning of this script, set those steps:
If Field = 1
what about writing a custom menu that takes over the new record command?
Wow, three great pieces of advice and ideas in a row. I can't wait to try them all. Thanks
Since the script at creation would be creating (and storing) a barcode as an image, then the PrimaryIDBarCodeImage container field would be empty until the script ran.
In your script, you could have it check to see if that field is empty.
If ( IsEmpty ( ContainerFieldForPrimaryIDBarCodeImage ) )
Run the script to generate the barcode