Atronics wrote:I want to have a message popup when specific debtors are selected in the sales order form. The following code gets the popup to work on saving the sales order
Private Sub SalesOrderSaveEnd(ByVal sender As Object,ByVal e As System.EventArgs)
How do I get to to work, once the debtor is selected?
Add a handler to the CreateEnd event and examine the Debtor property of the sales order - i.e.:
- Code: Select all
Public Sub Setup(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.Setup
Dim salesOrderForm As JiwaSalesUI.SalesOrder.BaseSalesOrderEntryForm = DirectCast(JiwaForm, JiwaSalesUI.SalesOrder.BaseSalesOrderEntryForm)
AddHandler salesOrderForm.SalesOrder.CreateEnd, AddressOf SalesOrder_CreateEnd
End Sub
Public Sub SalesOrder_CreateEnd(sender As Object, e As System.EventArgs)
Dim salesOrder As JiwaSales.SalesOrder.SalesOrder = DirectCast(sender, JiwaSales.SalesOrder.SalesOrder)
If salesOrder.Debtor.AccountNo = "1001" Then
MessageBox.Show("Debtor is 1001")
End If
End Sub
Attached is a VB.NET plugin which does this.