11/25/2024 4:38:29 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.
|
|
|
|
Move items from one list box1 to listbox2
Posted: 01 Apr 09 1:19 PM
|
Hi,
I have to add two list boxes to an existing legacy form. When the user selects item(s) from the first listbox, on the click of button1 the selected items should be added to the listbox2 and removed from listbox1. Similarly onclick of another button, the user should be able to remove the selected items from listbox2 and add to list box1. Any suggestions how to go about it?
ANY HELP WOULD BE HIGHLY APPRECIATED.
Thanks, Sundari |
|
|
|
Re: Move items from one list box1 to listbox2
Posted: 08 Apr 09 5:10 AM
|
Hi Sundari,
The joys of legacy code - it may be worth upgrading!
All that you will need to add a new legacy script for the WhenClick event of your Add button. In this I have 2 listboxes called ListBox and ListBox1, you can change the code accordingly:
Sub Main Dim strText as String 'Get Selected String strText = GetPropertyOf("ListBox", "Text") 'Validate that something was selected If strText = "" then Exit Sub
'Add to second List Box WithObject "ListBox1" ListAdd "Items", strText EndObject
'Remove form Starting List Box WithObject "ListBox" ListRemove "Items", strText EndObject
End Sub
You would then need to code it for the other way round too; and assign this to the WhenCLick event of your Remove button:
Sub Main Dim strText as String 'Get Selected String strText = GetPropertyOf("ListBox1", "Text") 'Validate that something was selected If strText = "" then Exit Sub
'Add to second List Box WithObject "ListBox" ListAdd "Items", strText EndObject
'Remove form Starting List Box WithObject "ListBox1" ListRemove "Items", strText EndObject
End Sub
Hope this helps,
Cheers
Steve |
|
|
| |
|
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!
|
|
|
|
|
|
|
|