Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, July 8, 2025 
 
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 - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Color change on history grid?
Jill D
Posts: 31
 
Color change on history grid?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Feb 10 2:15 PM
Hello - We want to change the row color in the history grid for each row equal to a value in the history.description field. We have tried the examples posted in the forum, but they don't work. No errors, just nothing happens. We are using SLX 7.2.
thanks!
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Color change on history grid?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Feb 10 7:28 AM
What event and script have you written?
[Reply][Quote]
Jill D
Posts: 31
 
Re: Color change on history grid?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Feb 10 10:40 AM
Thanks for replying. We are using the OnCustomDrawCell event, and the script is below.

Sub grdHistoryCustomDrawCell(Sender, ByRef Node, ByRef Column, IsSelected, IsFocused, ByRef Text, ByRef Color, ByRef Alignment, ByRef Font, ByRef FontColor)
Dim sFieldName
Dim vStatus
Dim lColumnIndex

sFieldName = UCase (Description) ' Field you want to look for

Select Case sFieldName
Case "A1.DESCRIPTION" ' ALIAS name of the column in QB

lColumnIndex = GetColumnIndexByFieldName (grdHistory,"A1.DESCRIPTION" ) ' Used so that grid can be sorted/grouped
vStatus = Node.Values ( lColumnIndex ) ' Gets the actual value
End Select

If Not IsNull ( vStatus ) Then ' Ensure you check for Nulls

Select Case vStatus
Case "G4-Escalation"
FontColor = wclCrimson
End Select
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]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Color change on history grid?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Feb 10 7:20 PM
Field names do NOT have A1. in them.

Suggest you put some debug code in here.....
[Reply][Quote]
Marcus
Posts: 6
 
Re: Color change on history grid? -- no problem Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Feb 10 5:50 AM
Hello Jill,

at the moment i try the same things, colorize some cells in a datagrid.... )

please try this modification in your code:

sFieldName = UCase (Column.FieldName) ' Field you want to look for

and don't forget to check for the right values in the SELECT CASE Statement, e.g. if you want to check the TICKET.STATUSCODE
for values like "open", "in process" etc., you have actually check for those values like "k6UJ9A000039", "k6UJ9A000038" ...... ))))

have a nice day

Marcus
[Reply][Quote]
Jill D
Posts: 31
 
Re: Color change on history grid? -- no problem Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Feb 10 10:21 AM
Here is what we got to work (in CustomDrawCell)

Sub grdHistoryCustomDrawCell(Sender, ByRef Node, ByRef Column, IsSelected, IsFocused, ByRef Text, ByRef Color, ByRef Alignment, ByRef Font, ByRef FontColor)


Dim sFieldName
Dim vStatus
Dim lColumnIndex

sFieldName = UCase ( Column.FieldName ) ' Field you want to look for

Select Case sFieldName
Case "CATEGORY" ' ALIAS name of the column in QB
lColumnIndex = GetColumnIndexByFieldName ( grdHistory,"CATEGORY" ) ' Used so that grid can be sorted/grouped
vStatus = Node.Values ( lColumnIndex ) ' Gets the actual value
End Select

If Not IsNull ( vStatus ) Then ' Ensure you check for Nulls

Select Case vStatus
Case "Escalation"
Color = &H000000FF
Font.Bold = True
End Select
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]
 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 © 2025 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): 7/8/2025 9:52:10 AM