I mentioned in the "Finalise Shipment event" forum post that 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.
I now have the CreatesDialog<frmAllocations> appearing correctly after the Finalise Shipment step, pre-filled with the associated payments. It appears to operate correctly and normally, allowing allocation of payments, which I do then click OK and the form closes. However, when I check the creditor transactions, the allocations have not happenned.
I haven't included a sample plugin as this is a multiple plugin sub-system and it is a little hard to isolate this aspect.
I lifted the code from the JiwaFinancials.Jiwa.JiwaCreditorsUI.frmCreditor.DisplayAllocationsForm(CreditorTransaction Transaction) method as follows:
- Code: Select all
_manager.DialogFactory.CreateDialog<frmAllocations>(new object[5] { transId, creditor, null, null, null }, _shipmentForm, "Creditors Maintenance").ShowDialog(_shipmentForm);
I have used _shipmentForm which is the current JiwaFinancials.Jiwa.JiwaLandedCostUI.Shipment.Shipment in place of "this" in frmCreditor.DisplayAllocationsForm (which is obviously the current frmCreditor) but I can't spot anything funky that frmAllocations is doing with the passed form.
I also tried a _manager.Database.Commit(); straight after the CreateDialog call, in case I was losing the allocations for lack of a commit, but this did not help.
Can you point out what I am missing?
Cheers,
Neil.