Hi Guys,
Have this plug in to show a message that order no is required. However message also pops up when printing. Is there a way to stop this.
In JIWA6 it was if printing = false.
Thanks for the help.
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 JiwaSalesUI.SalesOrder.BaseSalesOrderEntryForm Then
Dim salesOrderForm As JiwaSalesUI.SalesOrder.BaseSalesOrderEntryForm = DirectCast(JiwaForm, JiwaSalesUI.SalesOrder.BaseSalesOrderEntryForm)
AddHandler salesOrderForm.SalesOrder.SaveStart, AddressOf SalesOrder_SaveStart
End If
End Sub
Private Sub SalesOrder_SaveStart(sender As Object, e As System.EventArgs)
' msgbox ("in Save Start")
Dim salesOrder As JiwaSales.SalesOrder.SalesOrder = DirectCast(sender, JiwaSales.SalesOrder.SalesOrder)
If salesOrder.OrderNo.Trim.Length = 0 Then
' Throw New System.Exception("Sales Order - Order no may not be blank")
System.Windows.Forms.MessageBox.Show("Customer Order No Should not be blank ")
End If
' End If
End Sub
End Class