Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, July 5, 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: Datagrid
20pippo05
Posts: 46
 
DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 05 Feb 09 8:21 AM
I want create datagrid with checkbox for selected one row of data.How to do it?
[Reply][Quote]
Chris Burriss
Posts: 120
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Feb 09 8:56 AM
If defining columns through code, you can use this (notice the 4):

Set col = grdProducts.Columns.Add(4)
col.FieldName = "C_OPTIONALPRODUCT"
col.Caption = "Optional"

I will warn you that checkboxes in SLX datagrids could be better. My experience with them has been that NO event fires when you check or uncheck. The user has to click in the datagrid for the change event to be fired. In my example, I added an Optional checkbox to the Opportunity Products datagrid. On the change event, I had the sales potential amount updating to not include the optional products. I found that if the uses didn't purposely ensure the change triggered by clicking somewhere else in the datagrid, the Opportunity values would not update correctly. I hope this helps.

C. Burriss
[Reply][Quote]
20pippo05
Posts: 46
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Feb 09 1:49 PM
i have defined columns with sql.i create the new column of checkbox type but i don't can modify the check
[Reply][Quote]
Stainless Steel Snake
Posts: 32
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Feb 09 2:20 AM
If you wanna toggle checkbox manually by click on corresponding cell, then make sure that next properties are setted:
DataGridName.ReadOnly = False
DataGridName.RowSelect = False
ColumnName.ReadOnly = False

If you wanna toggle checkbox programmatically, then:
  1. make sure that DataGrid property Sortable setted on True

  2. Use code like that
    Call DataGridName.SetFieldValue(DataGridName.GetCurrentField, "FieldName" , "T", true)

[Reply][Quote]
20pippo05
Posts: 46
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Feb 09 1:29 PM
How create datagrid with VBscript?i have stored the data into recordset and i want to write data into new datagrid
[Reply][Quote]
Stainless Steel Snake
Posts: 32
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Feb 09 4:58 AM
First, you must have DataGrid control on the Form. You can't create DataGrid control dynamically.
Then, use DataGridName.Recordset = objRS to associate your DataGrid with data in onjRS recordset.
And then you should create columns for each field in recordset. Do this with DataGridName.Columns.Add(ColumnType). See reference here: http://slxdeveloper.com/page.aspx?action=viewarticle&articleid=26. Don't forget to specify Key Field property for DataGrid: DataGridName.KeyField = "KeyFieldName" .
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Feb 09 9:30 AM
Quote:
Originally posted by Stainless Steel Snake

First, you must have DataGrid control on the Form. You can't create DataGrid control dynamically.
Then, use DataGridName.Recordset = objRS to associate your DataGrid with data in onjRS recordset.
And then you should create columns for each field in recordset. Do this with DataGridName.Columns.Add(ColumnType). See reference here: http://slxdeveloper.com/page.aspx?action=viewarticle&articleid=26. Don't forget to specify Key Field property for DataGrid: DataGridName.KeyField = "KeyFieldName" .

That's a little backward.....grids need to be defined first, then set the grid recordset to your ADO recordset.

You want to create the grid columns at runtime in the FormCreate or FormOpen event...only if you haven't created them for that grid before.

AXFormChange or click of a button
go out and get your data in a recordset.
Then
SET Grid.RecordSet = MyRS

the columns in the grid take the fields in the Record Set and map the values for you.

and setting the grid.recordset means you DO NOT have to do a
grid.REFRESH

[Reply][Quote]
20pippo05
Posts: 46
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Feb 09 1:43 PM
Ok.Now,i want to write the recorset into saleslogix table.Example:

Do while not objRS.Eof
Insert into ACCOUNT ('accountid','account')(............,'objRS.Fields(1)')
OBJRS.MoveNext
Loop

I must to define the accountid for each row.
[Reply][Quote]
Stainless Steel Snake
Posts: 32
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Feb 09 3:15 AM
AccountID = Application.BasicFunctions.GetIDFor("ACCOUNT")
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 17 Feb 09 11:32 PM
Quote:
Originally posted by 20pippo05

Ok.Now,i want to write the recorset into saleslogix table.Example:

Do while not objRS.Eof
Insert into ACCOUNT ('accountid','account')(............,'objRS.Fields(1)')
OBJRS.MoveNext
Loop

I must to define the accountid for each row.


Be careful here. You cannot create a new account just by INSERTing a single row in the ACCOUNT table. There are several other tables to populate.

Phil
[Reply][Quote]
20pippo05
Posts: 46
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Feb 09 5:30 AM
for i=1 To DataGrid1.Selection.Count-1
............
Next


I don't have select row but it memorize the first row
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Feb 09 5:37 AM
Are you asking a question? If so, please clarify.
[Reply][Quote]
20pippo05
Posts: 46
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Feb 09 2:10 PM
I create the button for store the data.
If i click button but i'm not select the row ,the program doesn't must store the data.Instead store the first row because the first row is dashed but not select.
[Reply][Quote]
20pippo05
Posts: 46
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Feb 09 7:41 AM
When i open the datagrid ,the first row is select.How to do for see the first row unselect?
[Reply][Quote]
Stainless Steel Snake
Posts: 32
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Feb 09 8:17 AM
It is impossible to deselect all rows in datagrid. At least one row always remains selected.
[Reply][Quote]
20pippo05
Posts: 46
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Feb 09 10:57 AM
I create the other button.It must open the product form (name:Articoli) but sends the error message : Cannot find the subject required by the system:Atricoli plugin using the option you slected.Why?
[Reply][Quote]
Stainless Steel Snake
Posts: 32
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Feb 09 1:04 PM
When you describe the problem in the code, would be better to write an example of it. It would be difficult to understand where the problem lies without fragment of code.
[Reply][Quote]
20pippo05
Posts: 46
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Feb 09 2:48 PM
I create the button in the sales toolbar in the left panel.When i click the button,open the form.The form is product form and family system.But clicking on button the saleslogix sends the error message : Cannot find the subject required by the system:New Form plugin using the option you slected.Why?
[Reply][Quote]
Stainless Steel Snake
Posts: 32
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 24 Feb 09 1:59 AM
You must use Manage Form instead Product Form, because system can't automatically bind field ProductID to form's property CurrentID. And also, you may call your Product Form from script using Application.MainViews.Add or Application.MainViews.AddEx (there you should specify ProductID).
[Reply][Quote]
Rafael S.
Posts: 66
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Jun 11 7:49 AM
fiogf49gjkf0d

Hi Snake/People ,


 


Im still having trouble to create a checkbox column in datagrid.... I created the column in design time, but when i execute in slx, i cant check or uncheck the column...i did everything you say in you previous post, but dont works... my code:


dg.ReadOnly = false
dg.RowSelect = false

 


Set col = dg.Columns.Add(4)
col.FieldName = ""
col.Caption = ""
col.Width = 50
col.ReadOnly = false
col.DisableEditor = false

 


 


could you help me? thanks!


 


 

[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Jun 11 8:19 AM
fiogf49gjkf0d

Your fieldname is wrong. You need to set it to a valid column (part of the recordset). Otherwise, it'll have no idea what to update. The caption is the column header.

[Reply][Quote]
Rafael S.
Posts: 66
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Jun 11 8:34 AM
fiogf49gjkf0d

Hi Mike, thanks for answer..


I changed to this:


   Set col = dgPesquisa.Columns.Add(4)

    col.FieldName = "STATUS"
    col.Caption = "Status"
    col.Width = 50
    col.ReadOnly = false
    col.DisableEditor = false


Now, the dgCheckColumnToggle event fires....But the clumn dont check in the grid when i click.... any other idea?


thanks so much!

[Reply][Quote]
Rafael S.
Posts: 66
 
Re: DatagridYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Jun 11 11:24 AM
fiogf49gjkf0d

Mike / Guys


 


Worked here...was the fieldname not set... but now, i have other problem... Embarassed


When i click in the column, it would be save the "T" of "F" in the databse field. But only saves when i click in other row. Example: I check the first row... Dont save until i check another row... When i click in other row, it saves... any ideas for this?


 


thanks!


 

[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/5/2025 9:10:24 AM