Accessing sales order lines by line number ( index )
I need to loop through OR access the sales order lines using the incremental number ( NOT in a For Each loop )
however my syntax gives me an error "Overload resolution failed because no accessible "Item" can be called without a narrowing conversion"
on compilaiton - see my code below. The issue is on the msgbox line
appreciate if someone can help.
however my syntax gives me an error "Overload resolution failed because no accessible "Item" can be called without a narrowing conversion"
on compilaiton - see my code below. The issue is on the msgbox line
appreciate if someone can help.
- Code: Select all
Public Sub Setup(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.Setup
If TypeOf JiwaForm Is JiwaSalesUI.SalesOrder.SalesOrderEntryForm Then
Dim SalesOrdForm As JiwaSalesUI.SalesOrder.SalesOrderEntryForm = DirectCast(JiwaForm, JiwaApplication.IJiwaForm)
' AddHandler SalesOrdForm.SalesOrder.Created , AddressOf SalesOrderCreated
AddHandler SalesOrdForm.SalesOrder.CreateEnd , AddressOf SalesOrderCreateEnd
End If
End Sub
Public Sub SalesOrderCreateEnd(ByVal sender As Object ,ByVal e As System.EventArgs )
Dim oSalesOrder As JiwaSales.SalesOrder.SalesOrder = DirectCast( sender , JiwaSales.SalesOrder.SalesOrder )
Dim lOrdLine As Long
For lOrdLine = 1 To oSalesOrder.SalesOrderLines.Count
msgbox( oSalesOrder.SalesOrderLines.Item(lOrdLine).PartNo.ToString())
Next
End Sub