Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, August 24, 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: No data displays in grid
Bill
Posts: 71
 
No data displays in gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Jun 08 12:56 PM
I have a dynamically created grid that is on a managed form. I execute the script and the column captions will get added to the grid but no data displays. I added a message box to display the objRS.RecordCount and it returns a count of 8 records for the query. I run the sql statement in Query Analyzer and I get the 8 records returned with no errors. I have compared the grid properties with another grid I have that is created dynamically and I can't see anything incorrect. Using version 6.2.6..........any thoughts??
[Reply][Quote]
Timmus Agersea
Posts: 328
 
Re: No data displays in gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Jun 08 2:29 PM
Does grid.refresh help? If not, seeing the code would be helpful.

Timmus
[Reply][Quote]
Bill
Posts: 71
 
Re: No data displays in gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Jun 08 2:39 PM
I thought of that also, but I wasn't lucky enough to get it to work. Here is the code that I am using for the grid:

strSQL = "select isnull(A4.FIRSTNAME,' ') + ' ' + isnull(A4.LASTNAME,'') + ' ' + isnull(A4.SUFFIX,'') as Attendee, " & _
"A3.customer_id, A5.account, A6.city, A6.state, A2.class_name, A2.class_code, A2.start_date, " & _
"A7.breakout_name, A7.start_date, A7.location " & _
"from tr_waiting_list A1 " & _
"left outer join tr_class A2 on (A1.tr_classid = A2.tr_classid) " & _
"left outer join c_account A3 on (A1.accountid = A3.accountid) " & _
"left outer join contact A4 on (A1.contactid = A4.contactid) " & _
"left outer join account A5 on (A1.accountid = A5.accountid) " & _
"inner join address A6 on (A5.addressid = A6.addressid) " & _
"left outer join tr_breakout A7 on (A1.tr_breakoutid = A7.tr_breakoutid) " & _
"where A1.tr_classid = 'Q6UJ9A0EFS49'"

set objConn = Application.GetNewConnection
set objRS = objConn.Execute(strSQL)

dgWaitingList.SQL.Text = strSQL
dgWaitingList.ReadOnly = True
dgWaitingList.RowSelect = True
dgWaitingList.Sortable = True
dgWaitingList.Refresh

If dgWaitingList.Columns.Count > 0 then
For I = 0 to dgWaitingList.Columns.Count - 1
dgWaitingList.Columns.Item(0).Delete
Next
End If

Set objRS = dgWaitingList.Recordset
For Each fld In objRS.Fields
Set col = dgWaitingList.Columns.Add(0)
col.FieldName = fld.Name
col.Caption = fld.Name
Next

dgWaitingList.Columns.Item(0).Width = 125
dgWaitingList.Columns.Item(0).Caption = "Attendee"
dgWaitingList.Columns.Item(0).Visible = true
dgWaitingList.Columns.Item(1).Width = 55
dgWaitingList.Columns.Item(1).Caption = "Cust ID"
dgWaitingList.Columns.Item(2).Width = 140
dgWaitingList.Columns.Item(2).Caption = "Account"
dgWaitingList.Columns.Item(3).Width = 125
dgWaitingList.Columns.Item(3).Caption = "City"
dgWaitingList.Columns.Item(4).Width = 125
dgWaitingList.Columns.Item(4).Caption = "State"
dgWaitingList.Columns.Item(5).Width = 125
dgWaitingList.Columns.Item(5).Caption = "Class Name"
dgWaitingList.Columns.Item(6).Width = 125
dgWaitingList.Columns.Item(6).Caption = "Class Code"
dgWaitingList.Columns.Item(7).Width = 125
dgWaitingList.Columns.Item(7).Caption = "Class Start Date"
dgWaitingList.Columns.Item(8).Width = 125
dgWaitingList.Columns.Item(8).Caption = "Breakout Name"
dgWaitingList.Columns.Item(9).Width = 125
dgWaitingList.Columns.Item(9).Caption = "Breakout Start Date"
dgWaitingList.Columns.Item(10).Width = 125
dgWaitingList.Columns.Item(10).Caption = "Location"

set objConn = nothing
set objRS = nothing
dgWaitingList.Refresh
[Reply][Quote]
Timmus Agersea
Posts: 328
 
Re: No data displays in gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Jun 08 2:48 PM
In your case you are retrieving the recordset so you can set the grid.Recordset property to your recordset variable rather than setting the Grid.SQL.Text property. You will not need to refresh as setting the recordset property will cause it to repaint.

I also declare my recordset variable at the form level when I use this approach. This ensures the recordset is in scope for the life of the form.

You may want to set the recordset property after you build the grid columns. This may not matter but it is worth a shot.

Lastly, why are you building the grid dynamically? The SQL seems straight forward and could be done at design time. If the attendee aliased column concatenation is the problem, simply add a calculated field and you will be able to drag it into your grid layout at design time. You may have other reasons; I am just trying to simplify for you if possible.

Timmus
[Reply][Quote]
Bill
Posts: 71
 
Re: No data displays in gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Jun 08 2:59 PM
The grid is one of several grids that are being displayed on a tab control on a managed form so it was just easier to code everything. The tab that this grid is displayed on is only visible if certain conditions are met. With my recorset variable I set it to equal nothing as soon as I can so the same variable can be re-used for the other grids that get populated on the tab. Thanks for the reply...........I will see if I can get the data populated.
[Reply][Quote]
Bill
Posts: 71
 
Re: No data displays in gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Jun 08 3:54 PM
I am able to get data to populate in the grid by using all of the existing code and changing the select statement to a simple "select * from tr_waiting_list". Once I add a where condition or a join nothing displays in the grid.

Anybody have any thoughts on this????
[Reply][Quote]
Timmus Agersea
Posts: 328
 
Re: No data displays in gridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Jun 08 4:55 PM
Try changing your address inner join to a left join.

Timmus
[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): 8/24/2025 9:15:52 AM