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
   Editing Filters in Saleslogix Web Client 8.0
Is it possible to add or remove Saleslogix filters from the List view in Accounts?
Posted on Apr 08, 2014 by SalesLogix Support to SalesLogix Questions & Answers
 
   Bug in the Saleslogix Web LiveGrid Lookup dialog
I recently ran into an issue with the Opportunity Products grid in the Saleslogix web client.  I cli
Posted on Apr 04, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Saleslogix Web Client Controls are Missing
Every so often we hear that a user can no longer add products to an opportunity whether it is a new oppor
Posted on Mar 24, 2014 by Mark Duthoy to SalesLogix Support
 
   Major Problem in Saleslogix v8.1 Cloud Instances
I have been working with a new client who is on the hosted cloud solution for Saleslogix version 8.1.&nbs
Posted on Mar 19, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Setting the Defaults on the Insert Account/Contact Duplicate Record View
When creating a new Account/Contact record in Saleslogix web, you have the ability to check for duplicat
Posted on Mar 10, 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