I am trying to write plugin to write a CSV file on activation of a Warehouse Transfer Out.
I cannot seem to find the correct syntax for the form variable.
Although the plugin compiles successfully, when loading the warehouse transfer form I am getting an error.
For now, I'd be happy just to get a messagebox with an object of the form, say the Transfer number or destination warehouse description.
This is what I have so far:
- Code: Select all
Imports JiwaFinancials.Jiwa
Imports Microsoft.VisualBasic
Imports System.Windows.Forms
Imports System.Data.SqlClient
Imports System.Drawing
Imports System.Data
Public Class FormPlugin
Inherits System.MarshalByRefObject
Implements JiwaApplication.IJiwaFormPlugin
Public Overrides Function InitializeLifetimeService() As Object
' returning null here will prevent the lease manager
' from deleting the Object.
Return Nothing
End Function
Public Sub SetupBeforeHandlers(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.SetupBeforeHandlers
End Sub
Public Sub Setup(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.Setup
If TypeOf JiwaForm Is JiwaWhouseTransferUI.WarehouseTransferOut Then
Dim TransferForm As JiwaWhouseTransferUI.WarehouseTransferOut = DirectCast(JiwaForm, JiwaApplication.IJiwaForm)
AddHandler TransferForm.Activated , AddressOf WriteCSV
End If
End Sub
Private Sub WriteCSV(sender As Object , e As System.EventArgs )
Dim TransferForm As JiwaFinancials.Jiwa.JiwaWhouseTransfer.clsWarehouseTransfer = DirectCast(sender, JiwaWhouseTransfer.clsWarehouseTransfer)
Messagebox.show(TransferForm.DestinationWarehouseLogicalDescription)
End Sub
Thanks