Purchase Order Form Access
Our user would like the Purchase Order Line highlighted with a colour if Not fully delivered.
Seems easy enough as we have done line/ field highlighting in sales order using code like below. But there is no .Linedisplayed on the PurchaseOrderForm, And the purchaseorderform does not appear to have .grdlines.
Is this possible with the PO form. Thx..
AddHandler salesOrderForm.LineDisplayed, AddressOf SalesOrderForm_LineDisplayed
Private Sub SalesOrderForm_LineDisplayed(ByVal sender As Object, ByVal e As System.EventArgs, ByVal SalesOrderLine As JiwaSales.SalesOrder.SalesOrderLine,ByVal RowPassed As Integer)
' Unlock delivered and demand columns for all physical items
Dim salesOrderForm As JiwaSalesUI.SalesOrder.SalesOrderEntryForm = sender
For row As Integer = 0 To salesOrderForm.grdLines.ActiveSheet.RowCount - 1
Dim key As String = salesOrderForm.grdLines.GridText("Key", row)
If key = salesOrderLine.RecID Then
' Scotts Extra If to change colour etc
If salesOrderLine.DiscountedPrice = 0 Then
salesOrderForm.grdLines.ActiveSheet.Cells(row, salesOrderForm.grdLines.ActiveSheet.Columns("ExtPrice").Index).BackColor = System.Drawing.Color.Red
Else
salesOrderForm.grdLines.ActiveSheet.Cells(row, salesOrderForm.grdLines.ActiveSheet.Columns("ExtPrice").Index).BackColor = System.Drawing.Color.White
End If
If salesOrderLine.QuantityDemand > 0 Then
salesOrderForm.grdLines.ActiveSheet.Cells(row, salesOrderForm.grdLines.ActiveSheet.Columns("QuantityDemand").Index).BackColor = System.Drawing.Color.Blue
Else
salesOrderForm.grdLines.ActiveSheet.Cells(row, salesOrderForm.grdLines.ActiveSheet.Columns("QuantityDemand").Index).BackColor = System.Drawing.Color.White
End If
Exit For
End If
Next
End Sub
Seems easy enough as we have done line/ field highlighting in sales order using code like below. But there is no .Linedisplayed on the PurchaseOrderForm, And the purchaseorderform does not appear to have .grdlines.
Is this possible with the PO form. Thx..
AddHandler salesOrderForm.LineDisplayed, AddressOf SalesOrderForm_LineDisplayed
Private Sub SalesOrderForm_LineDisplayed(ByVal sender As Object, ByVal e As System.EventArgs, ByVal SalesOrderLine As JiwaSales.SalesOrder.SalesOrderLine,ByVal RowPassed As Integer)
' Unlock delivered and demand columns for all physical items
Dim salesOrderForm As JiwaSalesUI.SalesOrder.SalesOrderEntryForm = sender
For row As Integer = 0 To salesOrderForm.grdLines.ActiveSheet.RowCount - 1
Dim key As String = salesOrderForm.grdLines.GridText("Key", row)
If key = salesOrderLine.RecID Then
' Scotts Extra If to change colour etc
If salesOrderLine.DiscountedPrice = 0 Then
salesOrderForm.grdLines.ActiveSheet.Cells(row, salesOrderForm.grdLines.ActiveSheet.Columns("ExtPrice").Index).BackColor = System.Drawing.Color.Red
Else
salesOrderForm.grdLines.ActiveSheet.Cells(row, salesOrderForm.grdLines.ActiveSheet.Columns("ExtPrice").Index).BackColor = System.Drawing.Color.White
End If
If salesOrderLine.QuantityDemand > 0 Then
salesOrderForm.grdLines.ActiveSheet.Cells(row, salesOrderForm.grdLines.ActiveSheet.Columns("QuantityDemand").Index).BackColor = System.Drawing.Color.Blue
Else
salesOrderForm.grdLines.ActiveSheet.Cells(row, salesOrderForm.grdLines.ActiveSheet.Columns("QuantityDemand").Index).BackColor = System.Drawing.Color.White
End If
Exit For
End If
Next
End Sub