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
   Editing Filters in Saleslogix Web Client 8.0
Is it possible to add or remove Saleslogix filters from the List view in Accounts?
Posted on Apr 08, 2014 by SalesLogix Support to SalesLogix Questions & Answers
 
   Bug in the Saleslogix Web LiveGrid Lookup dialog
I recently ran into an issue with the Opportunity Products grid in the Saleslogix web client.  I cli
Posted on Apr 04, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Saleslogix Web Client Controls are Missing
Every so often we hear that a user can no longer add products to an opportunity whether it is a new oppor
Posted on Mar 24, 2014 by Mark Duthoy to SalesLogix Support
 
   Major Problem in Saleslogix v8.1 Cloud Instances
I have been working with a new client who is on the hosted cloud solution for Saleslogix version 8.1.&nbs
Posted on Mar 19, 2014 by Kris Halsrud to Kris Halsrud's Blog
 
   Setting the Defaults on the Insert Account/Contact Duplicate Record View
When creating a new Account/Contact record in Saleslogix web, you have the ability to check for duplicat
Posted on Mar 10, 2014 by Jason Buss to Jason Buss' Blog
 
Comments

No Comments

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