Page 1 of 1

Highlight Demand

PostPosted: Tue May 19, 2015 6:35 pm
by 2can2
Hi, You created a sample plugin for me for Non Physical items to use demand.
I would like to now be able to highlight this if > 0, code in V6 was :
'Sales Orders Entry - ADD TO 'Form GridLines Displayed'
' Demand >0 Highlight Red ONLY if Unprocessed - DH
With FormObject.grdLines
.BlockMode = True
.Col = .GetColFromID(UCase("QuantityDemand"))
.Col2 = .Col
.Row = Row
.Row2 = Row
If SalesOrderLineObject Is Nothing Then
.BackColor = vbWhite
Else
If SalesOrderLineObject.QuantityDemand = 0 Then
.BackColor = vbWhite
Else
.BackColor = vbRed
End If
End If
End With
Can you give me some pointers to add in V7! Thanks

Re: Highlight Demand  Topic is solved

PostPosted: Wed May 20, 2015 11:18 am
by Scott.Pearce
The v7 equivalent code would be:

Code: Select all
If salesOrderLine.QuantityDemand > 0 Then
   salesOrderForm.grdLines.ActiveSheet.Cells(row, salesOrderForm.grdLines.ActiveSheet.Columns("QuantityDemand").Index).BackColor = System.Drawing.Color.Red
Else
   salesOrderForm.grdLines.ActiveSheet.Cells(row, salesOrderForm.grdLines.ActiveSheet.Columns("QuantityDemand").Index).BackColor = System.Drawing.Color.White
End If   


Looking at the sample plugin you mentioned (which I assume is the one at http://forums.jiwa.com.au/viewtopic.php ... p=991#p991), I think the above code would go *below* where the "QuantityDemand" gets unlocked (line 37).

Re: Highlight Demand

PostPosted: Tue Jun 02, 2015 11:59 am
by 2can2
Thanks Scott. Works a treat!