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
   InforCRM (formerly Saleslogix) Mobile - Clearing Out Earlier Customizations
If you started with an earlier version of SalesLogix Mobile, let's say version 7.5.4, and customized
Posted on Mar 30, 2015 by Mark Duthoy to SalesLogix Support
 
   How do you set the Base Directory when Deploying your Web Client on Infor CRM 8.1?
Question:How do I make sure my Base Directory is set correctly on Infor CRM ? Recently I had a custo
Posted on Mar 06, 2015 by Dale Richter to Infor CRM Questions & Answers
 
   How do I fix a corrupt Picklist in Infor CRM version 8.1?
I had a user ask how to fix a corrupt picklist. The picklist did not show any values when trying to e
Posted on Feb 06, 2015 by Dale Richter to Infor CRM Questions & Answers
 
   Creating a Searchable & Filterable ComboBox in Infor CRM (Saleslogix) Web Client
I've had a few posts lately covering the ComboBox control in the Infor CRM (Saleslogix) Web Client. T
Posted on Feb 05, 2015 by Ryan Farley to Ryan Farley's Blog
 
   Limiting the Height of the Infor CRM (Saleslogix) ComboBox Popup
In my last post, I discussed how the Infor CRM (Saleslogix) ComboBox is a Dijit Select form widget. This
Posted on Jan 29, 2015 by Ryan Farley to Ryan Farley's 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 © 2015 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

Upcoming Workshop Dates

No scheduled workshops