Page 1 of 1

Finalise Shipment event

PostPosted: Fri Sep 15, 2023 10:37 am
by neil.interactit
Hi guys,

I try to avoid these basic questions, but I'm stuck on something simple.

A client has me building a "Deposit Payments" sub system that allows creditor payments made ahead of a purchase order fullfillment or before shipment to be linked to the relevent POs/Shipments. This part is done. The next stage of the project is that after "Finalise Shipment" completes, they want a popup "Allocate deposit payments for this shipment?" which then CreatesDialog<frmAllocations> on the debit transaction created during Finalise Shipment, pre-filled with the associated payments.

I have a handle on the frmAllocations aspect, and this all looks do-able. I am stuck injecting this after "Finalise Shipment" completes. I have not found a Finalising/Finalised event, so I have been tracing the Shipment.ActivateRecord() flow but can't spot where the debit transaction gets created, which I was hoping to then spot an event fired that I could hook to.

Could you point me in the right direction?

Cheers,
Neil

Re: Finalise Shipment event  Topic is solved

PostPosted: Fri Sep 15, 2023 11:53 am
by Scott.Pearce
In SaveStart (or SaveEnding) look at Status and OriginalStatus. i.e. during save if the OriginalStatus is "BookingIn", and Status is "Closed", then that would indicate that the shipment is being finalised.

Sadly "OriginalStatus" is a friend so you will have to use reflection to look at it. Let me know if you need help doing this.

Re: Finalise Shipment event

PostPosted: Fri Sep 15, 2023 12:02 pm
by Mike.Sheen
FYI this property has been made public in 7.2.1 SR18 - DEV-10306

Re: Finalise Shipment event

PostPosted: Fri Sep 15, 2023 12:57 pm
by neil.interactit
Thanks Scott/Mike.

When I was tracing this through I stumbled across property Finalising which is already public and is the logic you specified, so I should be good with that.

BTW Scott, I might look at developing a mashup interpretor for phpBB with https://www.developerfusion.com/tools/c ... to-csharp/, so that when you type friend, I read protected!

Cheers,
Neil