Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, November 25, 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: Move items from one list box1 to listbox2
Sundari Sinha
Posts: 36
 
Move items from one list box1 to listbox2Your last visit to this thread was on 1/1/1970 12:00:00 AM
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
[Reply][Quote]
Steve Robertson
Posts: 146
 
Re: Move items from one list box1 to listbox2Your last visit to this thread was on 1/1/1970 12:00:00 AM
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
[Reply][Quote]
Sundari Sinha
Posts: 36
 
Re: Move items from one list box1 to listbox2Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Apr 09 8:57 AM
Hi Steve,


Thansk you very much for your reply- it worked!
I appreciate your input.

Thanks again

Sundari



[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/25/2024 5:23:21 AM