Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, April 29, 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 - 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: v7.5.2 - Dynamically Populate a DataGrid
Jim Mizia
Posts: 49
 
v7.5.2 - Dynamically Populate a DataGridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Feb 10 3:35 PM
Can someone tell me the syntax to dynamically populate a data grid?

I have a custom Account tab/grid that shows records from a custom table. I want to put a datagrid on the Add/edit form for that tab that I can populate with a record set from the USERINFO table.

I know that this task should be pretty easy, but I don't know the syntax to get the record set and use it to populate the data grid. Thanks for any examples/help!

Jim Mizia
[Reply][Quote]
Chris Burriss
Posts: 120
 
Re: v7.5.2 - Dynamically Populate a DataGridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Feb 10 3:22 AM
You can use a recordset (dgGrid.Recordset = rsRecordSet, I believe). However, I generally use the SQL property.

dgGrid.SQL.Text = "SELECT FirstName, LastName FROM UserInfo"
dgGrid.Refresh

This implies that you've configured the Columns property through the Property window. Many times, you may even want to manage the columns via code... which is the route I often go. Ryan Farley has an excellent article on this: http://www.slxdeveloper.com/page.aspx?id=35&articleid=26 If you're struggling with recordset syntax, you should be able to google something like "vbscript recordset tutorial" or even look at existing forms within SalesLogix. Also, you can add the System:SLX Database Support script via "Include Script". This include script has a class that simplifies some database tasks.
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: v7.5.2 - Dynamically Populate a DataGridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Feb 10 1:16 AM
dgGrid.SQL.Text = "SELECT FirstName, LastName FROM UserInfo"
dgGrid.Refresh

SQL.TEXT already does a refresh Chris, this fetches the data TWICE. Changing the Bindid, ConnectionString, RecordSet, and SQL.TEXT all fire off a refresh.....as well as .Refresh. OH, and a grid caption header click sort.....that's a refresh also.
[Reply][Quote]
Chris Burriss
Posts: 120
 
Re: v7.5.2 - Dynamically Populate a DataGridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Feb 10 1:33 AM
Good to know. Thanks for the info.
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: v7.5.2 - Dynamically Populate a DataGridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Feb 10 9:59 AM
Quote:
Originally posted by RJ Samp

dgGrid.SQL.Text = "SELECT FirstName, LastName FROM UserInfo"
dgGrid.Refresh

SQL.TEXT already does a refresh Chris, this fetches the data TWICE. Changing the Bindid, ConnectionString, RecordSet, and SQL.TEXT all fire off a refresh.....as well as .Refresh. OH, and a grid caption header click sort.....that's a refresh also.



I agree this works well in 7.5.2, but if you ever work in older versions you may need to verify what works and doesn't work.
I have ran into a case where removing the Refresh meant no Data being loaded, but keeping the Refresh caused indeed a double dip against the DB.
There was no way around it, straight and simple. No Refresh meant no data, and Refresh meant double load.
Off course, I have this noted for Upgrade time so that I could remove this "feature" from this specific environment.
[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): 4/29/2024 4:32:07 AM