How to know what fields has changed on the BO when the saved


Author
Message
Jeff Pagley
Jeff Pagley
Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
Hi SF,

My client has asked me to send an email alert when a value has changed in a field for a record.  Is there an event the BO fires that I can handle which tells me what fields has changed and the before and after values of those fields?

Or does anyone have any suggestions on how I can do this?

Thanks,

Jeff

Using C#/Visual Studio 2008
Replies
Keith Chisarik
Keith Chisarik
StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)StrataFrame VIP (2.4K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
If you want to do it via BO you can use the DataRowVersion on the underlying datarows

If NOT BO.CurrentRow.Item(colCount, Data.DataRowVersion.Original) = BO.CurrentRow.Item(colCount, Data.DataRowVersion.Current) Then

or if you want it all on the SQL Server you could do a trigger that looks at the values in the internal INSERTED AND DELETED tables

Keith Chisarik
Jeff Pagley
Jeff Pagley
Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)Advanced StrataFrame User (641 reputation)
Group: StrataFrame Users
Posts: 223, Visits: 893
Hi Keith,

How can I tell what field has changed on the BO?  Is there a way to know what are the before and after values of the field of the BO? And what BO event would I handle to access this info?  Any code examples would be appreciated.

I don't what to audit the information, but I want to send an email when certain fields' values changed in a record.  Therefore, I don't need to setup SQL triggers.

Thanks,

Jeff

Using C#/VS 2008
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