11/25/2024 5:38:40 AM
|
|
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!
Forum to discuss SalesLogix legacy development including views, scripts, etc.. View the code of conduct for posting guidelines.
|
|
|
|
Is it possible to dynamically populate legacy combo box in legacy form?
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. |
|
|
|
Re: Is it possible to dynamically populate legacy combo box in legacy form?
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. |
|
|
| |
|
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!
|
|
|
|
|
|
|
|