Pocessing a BO in AfterSave event


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Afte I save a BO, I need to do additional processing of the BO, updating some other tables and logging before and after data.

It would apear that the 'AfterSave' event is probably the best place to do this, but I cannot access rows marked for deletion.

I can copy the BO in the BeforeSave event (and then process it in the AfterSave Event) , but am having difficulty processing Deleted Records , as I cannot see them in the BO ( I have the OnlymarkAsDeleted option set when Deleting rows so they are not removed from the Database until I save) . Also when this flag is set, the AfterDeleteEvent still fires , even though the row will not have been physically removed from the Database table yet.

Any ideas appreciated
Replies
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Hi Ivan

Even if I do this, because I have the OnlyMarkAsDeleted set, the record is deletd from the BO (but not from the Database Table yet), but the user can Undo changes, which means the Deleted record is Undeleted. Still back to the situation where I cant , or dont want to anyway, do anything until the Backend Database tables have been updated.

I suppose ideally what I am looking for is the Business Object  (or some version of  it ) just prior to the database Update which has both the New,Modified and deleted rows in it).

I would have thought that anybody who is logging Audit type stuff must have already done this ?
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Yeah, I haven't tried OnlyMarkAsDeleted on a maintenance form. I did it when programmatically deleting many records.

The way I would go would be, as I said, to use the BeforeDelete, get that record on a temp BO and deal with it AfterSave. In the case of an Undo, nothing would have to be done.

But I guess someone else who has approached this in a different maner might jump in and give you some other ideas.

Cheers.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Ger Cannoll - 14 Years Ago
Ivan George Borges - 14 Years Ago
Ger Cannoll - 14 Years Ago
Ivan George Borges - 14 Years Ago
Ger Cannoll - 14 Years Ago
                         [quote]I cannot see anyway within the BusinessObject to trap a Delete...
Ivan George Borges - 14 Years Ago
                             Hi Ivan Even if I do this, because I have the OnlyMarkAsDeleted set,...
Ger Cannoll - 14 Years Ago
                                 Yeah, I haven't tried OnlyMarkAsDeleted on a maintenance form. I did...
Ivan George Borges - 14 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search