Login / Register  search  syndication  about

          Kris Halsrud's Blog

Kris Halsrud on development and Integration with CRM and Development

Populating a ComboBox with picklists in the SalesLogix web

Here is a quick and easy way of populating a combo box control with a specific SalesLogix picklist’s values.

First, you can use the Picklist class in the Sage.SalesLogix.Picklists.dll assembly.

Lets say I have a picklist called “Vendor”.  To retrieve these values I can call this one line, using the GetPicklistItemsByName function:

System.Collections.Generic.IList<Sage.SalesLogix.PickLists.PickList> picklists = Sage.SalesLogix.PickLists.PickList.GetPickListItemsByName("Vendor", true);

Note that the function takes 2 parameters, the picklist you want to retrieve values for and a Boolean switch of returning the list in alphabetic order.

Now with that I can simply set a combo box’s DataSource property and call DataBind:

ComboBox1.DataSource = picklists;
ComboBox1.DataBind();

One other thing to note, it is typically a good idea to initialize a combo box with a blank line so that the user is forced to choose something.  You can do this via a line like this:

ComboBox1.Items.Insert(0, new ListItem(" ", " "));

The other thing to consider with doing something like that is that in order to allow a combination of manually inserted list items and a data bound list you need to set a property of the list box to allow appending data bound items after manually added items.  This looks like:

ComboBox1.AppendDataBoundItems =true;

Lets look at a full sample:

ComboBox1.Items.Clear();
ComboBox1.Items.Insert(0, new ListItem(" ", " "));
System.Collections.Generic.IList<Sage.SalesLogix.PickLists.PickList> picklists = Sage.SalesLogix.PickLists.PickList.GetPickListItemsByName("Vendor", true);
ComboBox1.DataSource = picklists;
ComboBox1.DataBind();

 

What's This?
  
Bookmark and Share

About Kris Halsrud

   Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.


Related Content
   Problem with the Clean Build Folders option in Application Architect
On occasion, it becomes necessary to clean out the build folders and deployed website prior to a build/de
Posted on Sep 16, 2014 by Jason Buss to Jason Buss' Blog
 
   ComboFix Kills Saleslogix Sync
ComboFix, a third party malware utility, will alter the Operating system so .qts and .que files will no l
Posted on Sep 12, 2014 by Brianna Ojard to SalesLogix Support
 
   Restricting Adding Opportunity Contacts to Contacts at the Opportunity's Account
 One thing that clients have asked for is how to restrict the selection of the Opportunity Contacts
Posted on Sep 09, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   How do I access the new Opportunity that I created in Saleslogix??
I had a user ask why they could not access a Salelogix opportunity when they clicked the hyperlink from t
Posted on Sep 04, 2014 by Dale Richter to SalesLogix Questions & Answers
 
   Configuring and Packaging secured actions in Saleslogix 8.0
Using Secured Actions, you can restrict access to user interface elements in the Saleslogix web client.
Posted on Aug 12, 2014 by Jason Buss to Jason Buss' Blog
 
Comments

 

Twitter Trackbacks for Populating a ComboBox with picklists in the SalesLogix web - Kris Halsrud's Blog [customerfx.com] on Topsy.com said:

Pingback from  Twitter Trackbacks for                 Populating a ComboBox with picklists in the SalesLogix web - Kris Halsrud's Blog         [customerfx.com]        on Topsy.com

April 30, 2010 10:36 AM
 

Joe Tame said:

Kris,

I loaded the assembly and tried to use the class in my code, I'm getting

The type 'Sage.SalesLogix.Orm.EntityBase' is defined in an assembly that is not referenced. You must add a reference to assembly 'Sage.SalesLogix, Version=7.5.3.4227, Culture=neutral, PublicKeyToken=null'.

Any idea what I'm doing wrong ?  I'm using 7.5.3.

thanks

JT

April 30, 2011 9:16 PM
 

Kris Halsrud said:

Are you adding this to a business rule?  If so you need to add a reference to the mentioned assembly in the business rules assembly reference definitions.  If you add this code to a quick form directly via a c# snippet action then you don't need to do this as the Quickforms do not rely on explicit references needed for the rules that are consolidated into their own assemblies.

May 2, 2011 8:24 AM
 

Samantha Knigge said:

Kris,

I'm trying to use a combo box in a C# snippet on a form load event. When I try to define the comboxbox1.datasource, it doesn't display the datasource property in intellisense. We're version 7.5.4.

What am I missing? I'd like to dynamically populate my combobox from an entity and add a filter.

Thanks so much!

Samantha

May 7, 2012 5:01 PM
 

Kris Halsrud said:

Samantha the intellisense built into the Application Architect is nowhere near complete.  You will have to open the deployed smartpart in Visual Studio from within your website to have full intellisense.

May 7, 2012 5:49 PM

Leave a Comment

(required)  
(optional)
(required)  
Add
All contents Copyright © 2014 Customer FX Corporation
Customer FX Corporation
2324 University Avenue West, Suite 115
Saint Paul, Minnesota 55114
Tel: 800.728.5783

  Follow @CustomerFX on twitter
Follow the best news, tips, and articles
  Subscribe to Customer FX on youtube
Watch SalesLogix tutorial videos from Customer FX
Login / Register