Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, November 30, 2024 
 
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!
 Architect Forums - Controls
Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Controls | New ThreadView:  Search:  
 Author  Thread: CustomDrawCell error following upgrade to 7.2.2
Scott Smallbeck
Posts: 62
 
CustomDrawCell error following upgrade to 7.2.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
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
[Reply][Quote]
Scott Smallbeck
Posts: 62
 
Re: CustomDrawCell error following upgrade to 7.2.2Your last visit to this thread was on 1/1/1970 12:00:00 AM
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")
[Reply][Quote]
 Page 1 of 1 
  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!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/30/2024 1:32:20 AM