Delphi AfterPost Event Equivalent


Author
Message
lastcanary
lastcanary
StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)
Group: StrataFrame Users
Posts: 81, Visits: 270
I was using Delphi AfterPost Event in my Delphi applications,

AfterPost event is fired after the data on the dataset is updated but before reflected to the database. If this is converted to the Business Object terminology when the business object is updated but before the update is reflected to the database. Is there an equivalent event in StrataFrame Business Objects?

If not, could you please suggest a method to handle it manually?
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Well, there are several events to handle this.  There is the BeforeSave event, AfterAddNew event, etc.  The BeforeSave will occur before the records are saved to the database.
lastcanary
lastcanary
StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)
Group: StrataFrame Users
Posts: 81, Visits: 270
Let me explain my situation in more details.

I have a listview and I am adding child records to it. When I add a record to the listview I would like to have an event triggering at that point. In the listview the record is just added to the Business Object but it is not added to the actual database. BeforeSave event is triggered after I click on save and try to save the record to the actual database but this is too late for me.

I would like to have an event at the Business Object level. I would not like to have a listview event so that my code resides only on Business Object
Edited 12 Years Ago by lastcanary
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)Strategic Support Team Member (3.5K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
You could use the ListView event just to call a Method on your Business Object. This way, your logic would reside in the BO.
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Lascanary,

lastcanary (1/19/2012)
I would like to have an event at the Business Object level. I would not like to have a listview event so that my code resides only on Business Object

All the events are at the business object level, not the list view.  If it is too hard to explain, I think that if you create a small sample application showing the issue it will be easier to help you find the correct event.

As Trent said, the Business Object Before/After Save/Add events are the logical places to write your code.

I was using Delphi AfterPost Event in my Delphi applications,
AfterPost event is fired after the data on the dataset is updated but before reflected to the database.

The Business Object BeforeSave would be the equivalent to Delphi AfterPost based on your statement above.

Edhy Rijo

lastcanary
lastcanary
StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)StrataFrame User (155 reputation)
Group: StrataFrame Users
Posts: 81, Visits: 270
I will try to explain the situation in more details.

Please try to think a form that has textbox controls and a listview control. When I add a record to the listview I would like to trigger an event so that it automatically calculates some formula using the data from the listview and other textboxes and writes the result to another textbox.

Business Object BeforeSave event is triggered when I press Save button but in this case I not pressing the save button.

I hope that this clarifies the problem.
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Sorry but you really need to do a quick sample application.
When you add a record to the list view, you are simply adding a record to the BO, so the PostAdd event will trigger, if you need to track when some information changes in each textbox, then you can use the BO Field Changing events.  This would be so much easier with a sample application where you can see the outcome.

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