Login / Register  search  syndication  about

          Kris Halsrud's Blog

Kris Halsrud on development and Integration with CRM and Development

Changing the Default Operator in the SalesLogix Lookup Control in the SalesLogix 7.5.4 Web Client

In the SalesLogix web client, the Lookup Control is a custom composite control that is contained in a compiled Sage assembly.  When you perform a lookup with this control, the operators available are based upon the type of field being looked up for.  For string fields, the default operator is “Contains”

SalesLogix Lookup Control

 

The reason the “Contains” operator is the default is because it is the first option on the drop down list.  Luckily the drop down list is not constructed from within the Sage Controls assembly.  Rather a client library is used to add the operators using Ext-JS.

The code for this client library is in the VFS under Portal Manager…Sage SalesLogix…Support Files…JScript…Sage-Controls.  There are two files involved:

  • Sage-Controls-Lookup.JS
  • Sage-Controls.JS

The Sage-Controls is a composite of all of the other script files and is minified.  This is the file that is actually used by the deployed web site.

If we look in the human-readable Sage-Controls-Lookup.js file we can see code around line 80 that looks like:

LookupControl.__operators = {
    "System.String": [
        {name: "LookupControl_Operator_Contains", value: "ct"},
        {name: "LookupControl_Operator_StartsWith", value: "sw"},       
        {name: "LookupControl_Operator_Equal", value: "eq"},
        {name: "LookupControl_Operator_NotEqual", value: "ne"},
        {name: "LookupControl_Operator_GT", value: "gt"},
        {name: "LookupControl_Operator_GE", value: "ge"},
        {name: "LookupControl_Operator_LT", value: "lt"},
        {name: "LookupControl_Operator_LE", value: "le"}       
    ],

This code is what is constructing the list of Operators available in the Lookup for a string field lookup.

If we wanted to change the lookup behavior so that Starts With is the default option, we simply need to make that operator the first one added to the list.

LookupControl.__operators = {
    "System.String": [
        {name: "LookupControl_Operator_StartsWith", value: "sw"},
        {name: "LookupControl_Operator_Contains", value: "ct"},               
        {name: "LookupControl_Operator_Equal", value: "eq"},
        {name: "LookupControl_Operator_NotEqual", value: "ne"},
        {name: "LookupControl_Operator_GT", value: "gt"},
        {name: "LookupControl_Operator_GE", value: "ge"},
        {name: "LookupControl_Operator_LT", value: "lt"},
        {name: "LookupControl_Operator_LE", value: "le"}       
    ],

Now to make this change actually take effect, you need to modify the minified sage-controls.js file.  The easiest way to do this is to search for “LookupControl_Operator_StartsWith”.  It should be around line 719.  Since it is minified there are no line breaks or spacing but if you make the equivalent change on this line, when you save these files and deploy, your lookup should then default to the operator at the top of your list.

 

What's This?
  
Bookmark and Share

About Kris Halsrud

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


Related Content
   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
 
   How to Disable the ComboBox Control in the Infor CRM (Saleslogix) Web Client
There's a problem with the ComboBox control in the Infor CRM (Saleslogix) Web Client. It won't di
Posted on Jan 22, 2015 by Ryan Farley to Ryan Farley's Blog
 
Comments

 

Kris Halsrud's Blog said:

The SalesLogix group area has a lookup control, that while it looks similar to the standard Lookup Control is actually a separate control with different code base. This post describes how you can change the default conditional operator of this control

May 31, 2012 2:14 PM
 

PieInTheSky said:

If you want to change the Display Name of the different operators, you can do this only with editing the "Sage.SalesLogix.Web.Controls.dll" in the directory "\Model\Portal\SlxClient\SupportFiles\Bin\".

Is this correct? Or is there another option to achieve this - maybe with editing the *.js-file mentioned in this article?

February 5, 2013 11:11 AM
 

Kris Halsrud said:

You cannot modify the dll so your only hope is to modify the js file.  You might be able to do something like this:

LookupControl.__operators = {

   "System.String": [

       {name: "LookupControl_Operator_StartsWith", value: "sw"},

       {name: "LookupControl_Operator_Contains", value: "ct"},              

       {name: "Apples", value: "eq"},

       {name: "Banana", value: "ne"},

       {name: "Chocolate", value: "gt"},

       {name: "Turnip", value: "ge"},

       {name: "Cabbage", value: "lt"},

       {name: "Olive", value: "le"}      

   ],

I dont know if that would work but is worth a try.

February 5, 2013 11:28 AM

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