Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, November 26, 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: Tree View control
Sarah Peterson
Posts: 37
 
Tree View controlYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 May 06 11:16 AM
fiogf49gjkf0d
I'm looking for some information and very simple sample code on use of the treeview control. I have started with the code from the Opportunity Products screen however, this code is way too much. I was hoping for an example of some simple code that doesn't include using filters and setting defaults, etc. I just want to know basically how to populate the treeview when it is first opened. With the Opportunity Product treeview, I cannot decifer what I need to exclude/include, etc.

Please help...
[Reply][Quote]
Kris Halsrud
Posts: 88
 
Re: Tree View controlYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 May 06 9:26 AM

viagra cena lekaren

viagra recenze pietschsoft.com
fiogf49gjkf0d
Basically what you need to do is create the tree views nodes and then looping through each node as needed populate the node with values.

To do this you could use the folowing:
Dim objCon
din strSQL
din objRS
dim objNode0

set objCon = Application.GetNewConnection
strSQL = "Select account, accountid from account"
set objRS = objCon.Execute (strSQL)

TreeView.Nodes.Clear
Set objNode0 = TreeView.Nodes.Add(,Nothing,"Account Name") 'This is the where the first level of the tree is created.
objNode0.tag = objrs.fields("accountid").value &""
with objrs
while not (.eof or .bof)
set objNode = TreeView.Nodes.AddChild(objNode0, objRS.Fields("Account").Value & "") 'This then populates the values under the specified node
.MoveNext
Wend
.Close
End With
Set objRS = Nothing


That is pretty much it, if you wanted to have multiple layers in the tree you would just nest another loop inside objNode0 for objNode1, etc. I did not test this code but it should give you the idea, hopefully.

[Reply][Quote]
Jeremy Brayton
Posts: 491
Top 10 forum poster: 491 posts
 
Re: Tree View controlYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 May 06 5:11 PM
fiogf49gjkf0d
A good reference for the SalesLogix controls are the Delphi counterparts (if you can decypher Delphi to a degree, or code in general really). TListView matches up with their ListView, TTreeView, etc. That's how I figured out how to manipulate a ListView but it may be that because I know a little bit about Delphi I was able to convert the examples I had to something functional in VBScript. The biggest issue is that you have to set objects as noted by the Set objNode0 = TreeView.Nodes.Add() function. You need to do the same when manipulating a ListView.

Then again both controls are related so they would require the same basic structure to function. I think a TreeView is a ListView on steroids or I may have that backwards.
[Reply][Quote]
victor
Posts: 1
 
Re: Tree View controlYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Sep 06 2:39 PM
fiogf49gjkf0d
the tested version of that script :

-----------------------------------------
Dim objCon
dim strSQL
dim objRS
dim objNode0
dim objNode

set objCon = Application.GetNewConnection
strSQL = "Select top 10 account, accountid from account"
set objRS = objCon.Execute (strSQL)

TreeView.Nodes.Clear
Set objNode0 = TreeView.Nodes.Add(Nothing,"Account Name") 'This is the where the first level of the tree is created.
objNode0.tag = objrs.fields("accountid").value &""
with objrs
while not (.eof or .bof)
set objNode = TreeView.Nodes.AddChild(objNode0, objRS.Fields("Account").Value & "") 'This then populates the values under the specified node
.MoveNext
Wend
.Close
End With
Set objRS = Nothing

-----------------------------------------
[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/26/2024 3:28:59 PM