Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, May 5, 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 - Legacy Development
Forum to discuss SalesLogix legacy development including views, scripts, etc.. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Legacy Development | New ThreadView:  Search:  
 Author  Thread: Is it possible to dynamically populate legacy combo box in legacy form?
randall miners
Posts: 2
 
Is it possible to dynamically populate legacy combo box in legacy form?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Jan 09 3:37 PM
There is a legacy form Add Account Screen where we want to add a combo box. We need to programmatically populate the
items in this combo box (long story but we need to issue a query to retrieve data from outside SLX and use those values as the items).

I have set the legacy form's WhenChange to a VB Script, and in that script used the application.form to get a reference as follows:

set frm = application.forms(i) ' where this is the forms(i).name which contains the combo box control

I can then see values of properties in the combo box, such as:

frm.cboControlName.Height

So I know that I am accessing the control, but there does not seem to be anyway in the VBScript to do something like:

frm.cboControlName.Items.Add("itemtext1")

...apparently because this is a LEGACY combo box control.

Does anyone know if it's possible do dynamically do this, or not? Thanks very much in advance.
[Reply][Quote]
Walter Shpuntoff
Posts: 167
 
Re: Is it possible to dynamically populate legacy combo box in legacy form?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Jan 09 4:37 AM
Sure... use a legacy script.

Here is a snippet of code (it had quite a bit of dust on it....)
sSQL is your query into your database. If it is external, then the call is something like DBOpenSQLFromDatabase... i don't remember the exact syntax.

dim hnd as long
dim iCnt as integer
dim sSQL as string

hnd = DBOpenSQL(sSQL, True)
DBMoveTo hnd, "Last"
iCnt = DBRecordCount(hnd)
DBMoveTo hnd, "First"
For i = 1 to iCnt
WithObject "Combobox"
ListAdd "Items", DBGetValue(hnd, "FieldName")
endObject
DBMoveTo hnd, "Next"
Next i
SetPropertyOf "Combobox", "Text", "(select)"
DBClose hnd


If you need some paid legacy help, contact me offline.
[Reply][Quote]
randall miners
Posts: 2
 
Re: Is it possible to dynamically populate legacy combo box in legacy form?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Jan 09 11:01 AM
Thank you, that was exactly what I was looking for. Works perfect.
[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): 5/5/2024 1:29:35 PM