Determining if a record is new during BeforeSave event


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.5K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I'm about to subclass the BusinessLayer type to handle some auditing. I'll need to know if a record is a new record. I was going to override the Save method (or maybe the OnBeforeSave method). In this I'll need to figure out if the record is new. If it isn't new, I'll need to save away the old values to my audit history table, but I won't need to call this for new records.



My first thought was to check the PK field (which in my case will always be an integer/identity field), to see if its value was < 0. Is there a better way?



Thanks!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search