New Event - AfterSavingRow

125 views
Skip to first unread message

Noam Honig

unread,
Feb 11, 2019, 11:13:55 PM2/11/19
to Migrated By Firefly
We've added an event called "AfterSavingRow" that is fired after the row was saved to the database - but before the transaction is committed.

To use it- just register to the event, here's an example:
public class ShowProducts : UIControllerBase
{
public readonly Models.Products Products = new Models.Products();
public ShowProducts()
{
From = Products;
AfterSavingRow += () =>
{
System.Windows.Forms.MessageBox.Show("Test");
};
}

Lawrence

unread,
Jul 14, 2021, 2:30:01 AM7/14/21
to Migrated By Firefly
How can I add this to our environment? I mean the AfterSavingRow code itself

Noam Honig

unread,
Jul 14, 2021, 2:33:44 AM7/14/21
to Lawrence, Migrated By Firefly
You'll need to change the firefly source code that you have if you're comfortable with that, or you can hire Aviv or Ilan to do it for you.


Noam Honig  
Founder & CEO


--
You received this message because you are subscribed to the Google Groups "Migrated By Firefly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to migrated-by-fir...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/migrated-by-firefly/76de4891-e804-4f74-adc4-fdcf7b8a2abfn%40googlegroups.com.

Lawrence Fisher

unread,
Jul 14, 2021, 3:44:43 AM7/14/21
to Noam Honig, Migrated By Firefly
Where do we add it and what do we add?

Lawrence
--
Sincerely

Lawrence
Award winning philatelic exhibit
Author of "Kill Me Now!"
https://stampandstories.blogspot.com

Noam Honig

unread,
Jul 14, 2021, 4:18:05 AM7/14/21
to Lawrence Fisher, Migrated By Firefly
Aviv is a contractor that has deep knowledge of the Firefly dll and can help make modifications to it.

He'll be able to track the code for AfterSavingRow in a new version, look at the version you're using and add that functionality there.


Noam Honig  
Founder & CEO

kcan...@gmail.com

unread,
Jul 14, 2021, 7:26:11 AM7/14/21
to Noam Honig, Lawrence Fisher, Migrated By Firefly

Noam,

 

Ran a migration using the newest firefly code (start without a version number), pulled it down but don’t see the AfterSavingRow event (looked in env.BusinessProcessBase.cs.

 

What class is it in?

 

Thanks,

 

Keith

image001.png
image002.png
image003.png

Noam Honig

unread,
Jul 14, 2021, 3:56:35 PM7/14/21
to Keith Canniff, Lawrence Fisher, Migrated By Firefly
In the  AbstractUIController (line 423) and in BusinessProcessBase (Line 438), you should see an event called AfterSavingRow





Noam Honig  

kcan...@integrateone.com

unread,
Jul 14, 2021, 5:11:18 PM7/14/21
to Noam Honig, Keith Canniff, Lawrence Fisher, Migrated By Firefly

So Noam,

 

I found it being used in AbstractUIController (line 671)

 

If (!e.Cancel)

               _levelProvider.AfterSavingRow();

 

and defined in Advanced.LevelProvider

 

public void AfterSavingRow()

{

               StartContext(“RM”, “RS”, null);

}

 

But it’s not in BusinessProcessBase

 

???

 

Keith Canniff
President and CTO
IntegrateOne LLC
www.integrateone.com
678-485-8665

image001.png
image002.png
image003.png
image004.png

Noam Honig

unread,
Jul 14, 2021, 5:16:17 PM7/14/21
to Keith Canniff, Keith Canniff, Lawrence Fisher, Migrated By Firefly
Hi Keith, 

I'm not sure what you're asking - you don't need to search for it's usage - this is it's definition.

In your code, you just use it as I outlined earlier in this thread.

public class ShowProducts : UIControllerBase
{
public readonly Models.Products Products = new Models.Products();
public ShowProducts()
{
From = Products;
AfterSavingRow += () =>
{
System.Windows.Forms.MessageBox.Show("Test");
};
}

Noam Honig  
Founder & CEO

kcan...@integrateone.com

unread,
Jul 14, 2021, 5:39:24 PM7/14/21
to Noam Honig, Keith Canniff, Lawrence Fisher, Migrated By Firefly

Noam,

 

What I’m saying is that we are using an older version of ENV in our application and if I pull the full newer version of ENV with our existing code, we get errors. I just migrated our code again under the new ENV so I could find out where the AfterSavingRow() method was so we copy and paste it into our older version.

 

However I need all the pieces of the method so I know what to paste into our older version, and there is no reference into our newer ENV under BusinessProcessBase to AfterSavingRow, so something doesn’t seem right.

 

That’s why I wanted you to look at the dotnet.rar file in our FTP folder so you could determine why I’m not seeing in the latest code what you’ve outlined below (including incorrect row numbers).

 

Keith Canniff
President and CTO
IntegrateOne LLC
www.integrateone.com
678-485-8665

 

image001.png
image002.png
image003.png
image004.png

Noam Honig

unread,
Jul 14, 2021, 7:02:29 PM7/14/21
to Keith Canniff, Keith Canniff, Lawrence Fisher, Migrated By Firefly
Hi Keith,

I understand, and that is why I recommended that you'll copy the specific lines I outlined in a previous email from the new ENV to an old ENV.

If they compile then your version of firefly has this feature.
If they do not, either because BusinessProcess or UIContorller don't have the AfterSavingRow event defined in firefly.box source code, then you'll need to make an adjustment to the firefly.box source code your using.

In that case, you'll need to grab a new version of firefly source code, and follow the code path of AfterSavingRow and copy it to your version of firefly - or you're welcome to hire Ilan or Aviv to do that for you, as they have experience in making changes with in the firefly.box source code.

Does this answer your question?
Noam Honig  
Founder & CEO

Noam Honig

unread,
Jul 14, 2021, 7:03:26 PM7/14/21
to Keith Canniff, Keith Canniff, Lawrence Fisher, Migrated By Firefly
As for looking at the ftp - I don't have access to it in the next few days and I would hate for you to wait.
Noam Honig  
Founder & CEO

kcan...@integrateone.com

unread,
Jul 15, 2021, 7:32:15 AM7/15/21
to Noam Honig, Keith Canniff, Lawrence Fisher, Migrated By Firefly

Noam,

 

The point I’m making is that I cannot find the lines you specified from the new ENV.

 

I went on the firefly ftp and converted the application again using the start instead of start.30132 (or whatever our version is) so I would get the latest firefly code.

 

When I downloaded it, again I cannot find the lines you’re specifying, but I’ll try converting it again and see.

image001.png
image002.png
image003.png
image004.png
Reply all
Reply to author
Forward
0 new messages