Login / Register  search  syndication

          Ryan Farley's Blog

Ryan Farley on .NET Development with a focus on CRM Development for SalesLogix

Adding a Default Sort to the Add Opportunity Products List in SalesLogix Web

Usually by the third time I see a question asked, I realize it needs to be a blog post. I've been asked by a couple of customers how to add a default sort to the products list on the Add Opportunity Products form in the SalesLogix Web client. The question of how to add a default sort to the list of products in the Add Opportunity Products form in the web client surfaced again today so I am posting the answer here.

The approach to sorting the products list on the Add Opportunity products form is different than what I have outlined before for simply sorting a grid. The opportunity products list is not a DataGrid, but a Tree control.

 

To sort the products list, instead of telling the control to sort, we will just sort the list of objects that it is bound to.

First, locate the AddOpportunityProduct SmartMart. This is a custom SmartPart, not a QuickForm, so you won't find this under the Opportunity entity itself, but instead in the Sage SalesLogix Portal in following location (we'll just need the code-behind, or "cs" file for this, not the "ascx" file):

Support Files\SmartParts\Opportunity\AddOpportunityProduct.ascx.cs

Double-click that file to open it in the Application Architect. In the code, look for the method named GetProductList. You'll see the following two lines at the very end of that method:

List<Product> ProductList = criteriaProduct.List<Product>() as List<Product>;
return ProductList;

Right before those two lines, add the following line (in this case, we'll sort the list by family):

criteriaProduct.AddOrder(expProduct.Asc("Family"));

Obviously, you can replace "Family" with any other valid property name on the Opportunity entity to sort the results by.

What's This?
Bookmark and Share

About Ryan Farley

   Ryan Farley is the Director of Development for Customer FX Corporation and the creator of slxdeveloper.com.


Related Content
   Adding an assembly reference to code files in the SalesLogix Application Architect
Often when adding custom code to SalesLogix you need to reference Assemblies that are not included by def
Posted on Mar 15, 2010 by Kris Halsrud to Kris Halsrud's Blog
 
   SalesLogix Web Client- Marketing Campaigns Part I [Video]
In this video webinar the Marketing Professional will learn how to create a New Marketing Campaign in Sal
Posted on Mar 15, 2010 by Dale Richter to SalesLogix Training
 
   Launching a report from a button in the SalesLogix web client
Starting in SalesLogix 7.5.1, Sage released an undocumented Reporting enhancement that allowed for intera
Posted on Mar 12, 2010 by Kris Halsrud to Kris Halsrud's Blog
 
   Hiding Opportunities in the SalesLogix web client
Occasionally we have clients who do not use the Opportunity components of the SalesLogix web client. 
Posted on Mar 10, 2010 by Kris Halsrud to Kris Halsrud's Blog
 
   Searching for Matching Records in the SalesLogix Web Client
In this short video the user will learn how to search for matching records while adding new records to th
Posted on Mar 10, 2010 by Dale Richter to Tech Talk
 
Comments

 

Nicolas Galler said:

Thanks for the post!  Just wanted to mention that in 7.5.2 it is in App_Code/AddOpportunityProductRequest.cs instead.

January 25, 2010 3:08 PM

Leave a Comment

(required)  
(optional)
(required)  
Add
All contents Copyright © 2010 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