Best Practice for LastModifiedUser and LastModifiedDate fields in a BO


Best Practice for LastModifiedUser and LastModifiedDate fields in a BO...
Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
You could create a BaseBO from which any BO could inherit that will need this kind of tracking.  For me, I am running into variations in the column names, so I have to address the issue on a BO by BO basis anyway.  It is relatively easy to setup...just one simple item in the mental checklist for creating a BO.  I could see where a BaseBO would be beneficial in a large, consistently named environment.
Edhy Rijo
E
StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Bill Cunnien (05/06/2008)
In the SetDefaultValues() I set the create information.  In the BeforeSave() I set the edit information.  I never have to think about it after that.
Bill

Hi Bill,

Thanks for the information it does make sense, only that having to do that manually for all BO may be a bit of work BigGrin I have a couple of VFP project which will be re-created in SF and I need to automate process like this as much as possible.

Edhy Rijo

Bill Cunnien
Bill Cunnien
StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)StrataFrame VIP (1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
Hey Edhy,

There are probably several ways to do this.  My approach is to create four fields on each table that I want to track this kind of activity: createby, createdate, editdby, editdate.  I retrieve the UserPK from the SF users table for the current user, then in the BO I use two built-in methods:  SetDefaultValues() and BeforeSave().  In the SetDefaultValues() I set the create information.  In the BeforeSave() I set the edit information.  I never have to think about it after that.

Hope that gives you some direction,
Bill

Edhy Rijo
E
StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)StrataFrame VIP (3.8K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi,

For some tables it is very useful to have a fields that will tell the user when was the record changed and by who. 

  • Is there anything in SF logic to auto update this kind of fields?
  • If these fields should be updated manually what would be the correct event to use to have these fields updated?

Thansk!

Edhy Rijo

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