11/30/2024 12:34:35 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
|
|
|
|
CustomDrawCell error following upgrade to 7.2.2
Posted: 12 May 08 12:13 PM
|
I upgraded a development database to 7.2.2 over the weekend (Not live for a while yet so that's good) and am getting an error on a custom tab where I am setting the background color of the rows if there is an order number.
The error is: "list index out of bounds (-1) on line 9 char 5." I'm playing around with the GetColumnIndexByFieldName function to work through it but thought I'd post in case someone knows the issue off the top of their head.
Here is the code that is getting the error (Thanks for the great posts that helped me get this together in the first place):
Sub dgQuotesCustomDrawCell(Sender, ByRef Node, ByRef Column, IsSelected, IsFocused, ByRef Text, ByRef Color, ByRef Alignment, ByRef Font, ByRef FontColor) Dim sFieldName Dim vONNo Dim lColumnIndex
lColumnIndex = GetColumnIndexByFieldName (dgQuotes,"ONNO") vONNo = Node.Values (lColumnIndex)
If NOT IsNull(vONNo) Then Color = Application.BasicFunctions.StringToColor("clGrayText") Else Color = Application.BasicFunctions.StringToColor("clWindow") End If
If IsSelected or IsFocused then Color = Application.BasicFunctions.StringToColor("clHighlight") End If End Sub
Function GetColumnIndexByFieldName ( ByRef Grid, ByVal FieldName ) Dim i Dim lColumnIndex
lColumnIndex = -1 For i = 0 To Grid.Columns.Count - 1 If UCase ( Grid.Columns(i).FieldName ) = UCase ( FieldName ) Then lColumnIndex = i Exit For End If Next GetColumnIndexByFieldName = lColumnIndex End Function |
|
|
|
Re: CustomDrawCell error following upgrade to 7.2.2
Posted: 12 May 08 12:53 PM
|
Just turns out that you need to include the table alias.
lColumnIndex = GetColumnIndexByFieldName (dgQuotes,"ONNO")
should be:
lColumnIndex = GetColumnIndexByFieldName (dgQuotes,"A1.ONNO") |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|