11/30/2024 6:35:41 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 usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
|
|
|
|
Functionality Without Controls?
Posted: 24 Oct 07 5:25 PM
|
Hi all;
I was looking at the following functions:
Application.BasicFunctions.LookupUser Application.BasicFunctions.LookupItemWithConditionByID ("Product:Name", True, "STATUS", "OBSOLETE", "<>", "")
I have been playing with it without much success and the documentation leaves a few items unanswered...
1.) Does anyone have a quick example of this? 2.) Do I have to have an actual control on my form to use this? 3.) Is there a similar call for bringing up a picklist without a control?
I was looking at cascading picklists & LookupEdit Controls to begin with; but if I don't actually have to handle a control - just a variable or Text field that would be pretty sweet!
Thanks, Carla |
|
|
|
Re: Functionality Without Controls?
Posted: 24 Oct 07 6:12 PM
|
Got 2/3 of it. The documentation was a bit clearer after getting away from my desk for minute!
Set objTest = Application.BasicFunctions.LookupUser strlueGeneric = objTest.DisplayName msgbox strlueGeneric
However, I did not find a similar call for picklists. |
|
|
|
Re: Functionality Without Controls?
Posted: 25 Oct 07 12:13 PM
|
Originally posted by Carla Tillman
However, I did not find a similar call for picklists. |
|
Hi Carla,
This is totally doable. The SLX Application object does have a picklist collection. You can use that to return a Picklist object and can invoke that however you want. Here's a sample invoking the "State" picklist and displaying the selected item in a msgbox.
Dim list Dim col Set list = Application.Picklists.Item("state") Set col = list.Select(4, "", 200, 200, 300, 300) If Not col Is Nothing Then MsgBox col.Item(0) End If Set list = Nothing
Here's what that is doing:
1) A Picklist object is retrieved from the Application.Picklists collection 2) The Select method is called on the Picklist to show the picklist dialog. The select method takes four parameters - PickListColumnsEnum: 1=Orders, 2=Codes, 4=Items (Text) - OldItemIDs: String of existing selected items (or blank if you want nothing selected) - Left: Left coordinates for the dialog - Top: Top coordinates for the dialog - Width: width of the dialog - Height: height of the dialog 3) The Select method returns an ICollection of strings that were selected. For the example above, I am assuming only a single item is selected
Does all that make sense?
-Ryan
|
|
|
|
Re: Functionality Without Controls?
Posted: 25 Oct 07 5:56 PM
|
Thanks Ryan!
I hadn't tried these methods before but I must say - it is awfully handy for cascading situations.
I will work with the code and let you know if I have any problems. Looks sensible.
Carla |
|
|
|
Re: Functionality Without Controls?
Posted: 20 Mar 08 1:41 AM
|
Oy, I have been trying for the last hour to figure out how to get the OldItemIDs to work. I am getting the Picklist up just fine, but I cannot get it to auto select anything in it. I tried a few things, including the following...
Set col = list.Select(4, "Commercial Plumbing", 400, 400, 300, 300) + Set col = list.Select(4, GetPicklistValueByItemID(list,"Commercial Plumbing",1), 400, 400, 300, 300)
The "Commercial Plumbing" is both Text and code for the valid picklist item. Any insight would be much appreciated.
I am trying to allow users to select multiple items from a picklist, store it into a memo field, then when they go to change the selections, make sure that what was selected before defaults to select again on open of the picklist, full code is below, the Val stuff was an attempt to change the textline list to a comma seperated one when I thought that OldItemIDs may simply take that
Sub Button1Click(Sender) Dim list Dim col Dim Vals Dim X Vals = Memo1.Text Vals = Replace(Vals, vbcrlf, ",") Set list = Application.Picklists.Item("Quote-TypeOfWork") Set col = list.Select(4, GetPicklistValueByItemID(list,"Commercial Plumbing",1), 400, 400, 300, 300) If Not col Is Nothing Then memo1.clear for X = 0 to col.count - 1 Memo1.lines(X) = col.item(X) + vbcrlf next End If Set list = Nothing End Sub
|
|
|
|
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!
|
|
|
|
|
|
|
|