Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 22, 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 - Controls
Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Controls | New ThreadView:  Search:  
 Author  Thread: How to get the ItemID for a picklist at runtime?
Mary
Posts: 17
 
How to get the ItemID for a picklist at runtime?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Sep 06 3:09 PM
fiogf49gjkf0d
Hello,

I need to save the text typed into a textbox to the picklist, which is bounded to this textbox. I know user can "Add" a new item through the picklist, but how to add a new item to the picklist when the user typed into the textbox without "Add" through the picklist?

If I need to insert the data into the picklist table by programming, how to get the "ItemID" for the new item, in order to save the record to the picklist table? and how to refresh the picklist so that user can see the changes in the picklist?

Any code examples? Please help.

Thank you very much in advance
[Reply][Quote]
Jeff Crawford
Posts: 52
 
Re: How to get the ItemID for a picklist at runtime?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Sep 06 12:03 PM
fiogf49gjkf0d
Mary,

Although I haven't tried it, this may work for you. Also, the Item Index may require an integer.

Call Application.PickLists.Item("PicklistName").Add("Text", "ShortText")

~JC
[Reply][Quote]
Mary
Posts: 17
 
Re: How to get the ItemID for a picklist at runtime?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Sep 06 3:15 PM
fiogf49gjkf0d
Thank you for your reply. But there is no "Add" method exists in this "Application.PickLists.Item("PicklistName") object.

Also I need to retrieve the ItemID first as I think the ItemID is the unique ID for the Item added into the "Picklist" table. Any ideas?

Thanks,
[Reply][Quote]
Jeff Crawford
Posts: 52
 
Re: How to get the ItemID for a picklist at runtime?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Sep 06 4:36 PM
fiogf49gjkf0d
Mary,

Type in...

Application.PickLists.Item.

and you will get the drop down with the add method. Once you append the add method, you can go back and back fill the Item Index. It's just the way SLX type ahead works.

---------------------------------------------------------------------------

This statment will get you all information you need for the top level picklist. (A1.Text is the name of your picklist.)

SELECT A1.*
FROM sysdba.Picklist A1
WHERE (A1.Text = '')
AND (A1.PickListID = 'PICKLISTLIST')

This statment will get you all the items contained in that picklist. (A1.Text is the name of your picklist.)

SELECT A2.*
FROM sysdba.Picklist A1
INNER JOIN sysdba.Picklist A2 ON (A1.ItemID = A2.PicklistID)
WHERE (A1.Text = '')
AND (A1.PickListID = 'PICKLISTLIST')

~JC
[Reply][Quote]
Mary
Posts: 17
 
Re: How to get the ItemID for a picklist at runtime?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Sep 06 8:59 AM
fiogf49gjkf0d
Thanks again Jeff. Is this function available in version 6.1 (sorry not to mention I am using version 6.1)? As I get the drop down without Add method in the list.
[Reply][Quote]
Jeff Crawford
Posts: 52
 
Re: How to get the ItemID for a picklist at runtime?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Sep 06 10:41 AM
fiogf49gjkf0d
Mary,

I'm sorry, but I do not have the version 6.1 software or documentation to review. Although, you should really consider moving to version 6.2 or higher. If I'm not mistaken, version 6.2 was the one that made the major revision to the SLX provider, which significantly improved the LAN client performance.

However, if you are not able to find a built in function to update the picklists, you can always just insert a row into the picklist table. Although, keep in mind that in order to refresh the picklist cache to show the inserted row, you will need to do a Ctrl+F5 to refresh the client after the insert. You can use the second SQL statement I posted to determine how the next row insert should be formatted.

~JC
[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: How to get the ItemID for a picklist at runtime?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Sep 06 2:58 AM
fiogf49gjkf0d
I just checked, the function is present in 6.1
[Reply][Quote]
Mary
Posts: 17
 
Re: How to get the ItemID for a picklist at runtime?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Sep 06 1:13 PM
fiogf49gjkf0d
Hello,

I don't know why my version(6.1.1.1018) doesn't have this built in function. I can only see the following methods/properties only;
Application.PickLists.Item("my picklist name")
.AllowEdit
.Count
.DefaultItem
.Fixed
.ID
.Item
.ItembyShortText(value)
...

There is no Add method at all
....
Application.PickLists.Count
Application.PickLists.Manage
Application.PickLists.Select

Now I don't want to spend so much time on this non-exist function. I want to use SQL insert statement to update the picklist table with the new values user entered into the text box.

Insert picklist (ID, TEXT, SHORTTEXT, ITEMID, PICKLISTID, USERID, DEFAULTINDEX) VALUES('55','MYTEXT','SHORTTEXT','ITEMID','MYPICKLISTID','ADMIN',NULL)

I noticed that the ItemID in "Picklist" table is generated by SalesLogix internally and should be unique. Can you tell how to generate/get this ItemID (Saleslogix ID) so I can insert this value into the table? Can I call
slx_DBIDs Saleslogix Stored Procedure to get the request SalesLogix ID for this table? But the example is in SLXSDN. Where can I find SLXSDN?

And I also noticed that Add a new item into the picklist, that item will be only available to that user, other users wont see the items that other users entered, unless, the item entered by "Admin" - will be available to everyone.

Any ideas? Thank you very much for all your responses.


[Reply][Quote]
Frank Chaffin
Posts: 475
 
Re: How to get the ItemID for a picklist at runtime?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Sep 06 5:03 PM
fiogf49gjkf0d
Mary,
Looks like I gave you bad information. I rechecked my 6.1.3 environment and the Add method is not there.

Sorry for the confusion.
[Reply][Quote]
Mary
Posts: 17
 
Re: How to get the ItemID for a picklist at runtime?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Sep 06 1:42 PM
fiogf49gjkf0d
Hello,

Dose any one know how to call or use "slx_DBIDs" stored procedure in Saleslogix 6.1? Is this ID generated by this "slx_DBIDs" stored procedure will be the new ItemID in the Picklist table?
Please help.

Thanks,
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: How to get the ItemID for a picklist at runtime?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 14 Sep 06 2:08 PM
fiogf49gjkf0d
See this article: http://www.slxdeveloper.com/page.aspx?action=viewarticle&articleid=87
[Reply][Quote]
Mary
Posts: 17
 
Re: How to get the ItemID for a picklist at runtime?Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Sep 06 8:52 AM
fiogf49gjkf0d
Thank you Ryan so much for your help!!! This is really what I am looking for.
I feel great now.
[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/22/2024 11:37:29 PM