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
   Confirming Actions With an "Are you sure?" Prompt in Infor CRM (Saleslogix)
I'm not a huge fan of bugging end users. I figure, if an end user clicked something, he or she meant
Posted on Nov 18, 2014 by Ryan Farley to Ryan Farley's Blog
 
   Manipulating the DependencyLookup Control in the Infor CRM Web Client (Formerly Saleslogix)
 The Dependency Lookup control in the Saleslogix web client is what is used for the hierarchical Are
Posted on Nov 14, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Infor CRM (formerly Saleslogix) Statement of Direction
Learn more about the future of Infor CRM. Recently I received my login information for the Infor Partn
Posted on Nov 13, 2014 by Brianna Ojard to The Inbox
 
   Adding a report link to the Common Tasks pane in Infor CRM (formerly Saleslogix)
When you are viewing an Entity Detail page, the Common Tasks pane on the right of the page provides a nu
Posted on Nov 12, 2014 by Jason Buss to Jason Buss' Blog
 
   How to Sum a Collection using Hibernate Criteria and Projections
 To sum the results of a criteria collection you can use code such as the following, which gets the
Posted on Nov 07, 2014 by Kris Halsrud to Kris Halsrud'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 © 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