Insert as Update history tracking methodology question


Author
Message
Rob Toyias
Rob Toyias
StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)
Group: Forum Members
Posts: 31, Visits: 179
We have some tables in our DB that manage history inside the table by only doing Inserts, adding an effective end date.

To do an 'Update' we actually enddate the existing record to Now and then insert a new record with the new data.  Were also using stored procs exclusivly for our CRUD.

Our table would look something like this:

-----------------
ProductPrimaryID
ProductID
ProductName
EffectiveEndDate
-----------------

The ProductPrimaryID would be unique for each record in the DB, and the ProductID would persist for each 'Updated' record.  So given all this what's the best way to approach this via SF?  An update in SF only returns an number for successful rows updated, I need to have it return the new ProductPrimaryID.  I thought of calling my Update proc with save() and then refilling my BO with the newly added record.  It's an extra trip to the DB but I think it should work.

Anyone else have any ideas or already have a more elegant way to fix this?

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