Login / Register  search  syndication  about

          Kris Halsrud's Blog

Kris Halsrud on development and Integration with CRM and Development

Globally filtering the Notes/History tab in the SalesLogix web client

 

In the SalesLogix web client, the Notes/History tab is largely based on client side binding.  The client side scripting handles the various functions the grid can perform like filtering.  One request I had recently is to globally filter the grid to exclude certain records regardless of what filers the users selected.  Now modifying the client side scripting could handle this, we can also do it a different way.

On the code file for the Notes History control (NotesHistoryList.ascx.cs) we see there is a OnFormBound event which is used to register a client side script onto the page:

 

protected override void OnFormBound()
   {
       base.OnFormBound();
       ScriptManager.RegisterClientScriptInclude(this, GetType(), "NotesHistoryList",
           Page.ResolveUrl("~/SmartParts/History/NotesHistoryList.js"));

       string scr = string.Format("Sage.UI.Forms.HistoryList.HistoryTypeMap = {{{0}}};", Server.HtmlEncode(BuildHistoryTypeMap()));
       ScriptManager.RegisterStartupScript(this, GetType(), "historyTypes", scr, true);

       var script =
           String.Format(
               @"window.setTimeout(function() {{ Sage.UI.Forms.HistoryList.init('{0}',
                   function() {{ return '{2} eq \'' + Sage.Utility.getCurrentEntityId() + '\''; }},
                   {{ workspace: '{1}', tabId: '{3}' }}); }}, 1);",
               placeholder.ClientID, getMyWorkspace(), GetParentField(), ID);

       if (!Page.IsPostBack)
       {
           script = string.Format("dojo.ready(function() {{ {0} }});", script);
       }
       ScriptManager.RegisterStartupScript(this, GetType(), "HistoryList_Init", script, true);
   }

If we modify the portion shown highlighted above we can pass in an additional criteria like so:

var script =
            String.Format(
                @"window.setTimeout(function() {{ Sage.UI.Forms.HistoryList.init('{0}',
                    function() {{ return '{2} eq \'' + Sage.Utility.getCurrentEntityId() + '\' and ({4})'; }},
                    {{ workspace: '{1}', tabId: '{3}' }}); }}, 1);",
                placeholder.ClientID, getMyWorkspace(), GetParentField(), ID, GetParentField() == "AccountId" ? "AttendeeHistory eq null or AttendeeHistory eq false" : "1 eq 1");

In this example we are checking to see what the GetParentField() function returns.  This function returns the key field used to filter.  In this case I only wanted to add a filter if we are on the Account screen (returns AccountId).  If it does we are adding an additional filter to look for a property called AttendeeHistory and only return null or false values. If not on the account screen, we are adding just a simple 1=1 statement to essentially not filter.

Adding a filter this way ensures it is globally applied even if the user chooses other filter options in the UI.

What's This?
  
Bookmark and Share

About Kris Halsrud

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


Related Content
   Easily Showing and Hiding Tabs at Runtime in Infor CRM (Saleslogix)
Showing and hiding tabs in the Infor CRM (Saleslogix) client should be an easy thing. It should be someth
Posted on Dec 16, 2014 by Ryan Farley to Ryan Farley's Blog
 
   Problem setting SLXTextbox enabled property / Setting unexposed base control properties for a custom control
I recently had an issue with a Quickform where I was attempting to set the Enabled property of a TextBox
Posted on Dec 05, 2014 by Jason Buss to Jason Buss' Blog
 
   Checking Infor CRM (Saleslogix) Picklists for valid data
This week I received a question about a particular picklist. One of the picklist items, when chosen, wou
Posted on Dec 05, 2014 by Dale Richter to Infor CRM Questions & Answers
 
   Avoiding the Dirty Data Message When Programatically Redirecting to a Record in Infor CRM (Saleslogix)
In my last post I wrote about using the OnClientClick property of a control (or button) to run JavaScript
Posted on Dec 02, 2014 by Ryan Farley to Ryan Farley's Blog
 
   Infor CRM (formerly Saleslogix) Web- Dependency Lookup OnChange Event Not Working Correctly
In the Saleslogix 8.1 web client the dependency lookup still has a problem with the OnChange event. 
Posted on Nov 26, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
Comments

 

SM said:

Hi there Kris - So how has this changed in SLX 8.0 . Where can i go to add a column in Notes History tab and expose the data?

December 17, 2014 9:59 AM
 

Kris Halsrud said:

SM this has completely changed in 8.  These screens are largely constructed client side now using a Sage js library.  Instead of modifying the core library you implement your own library that sits on top and modifies or overrides the default functionality.  This is more like developing for the mobile client.

There is a sample item Sage created called "The big Deal" customization.  This is about the only documentation on how you do things.  You can find it here: customerfx.com/.../saleslogix-v8-big-deal-example-file.aspx

December 17, 2014 11:08 AM

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