back to top

Adding a one click history print feature to the SalesLogix web client

One of the things that the SalesLogix LAN client had was the ability to print details about a single history item by selecting the record in the history grid and clicking a print button.

The SalesLogix web client does not have that capability.  But I am going to show you how to implement something similar.

 

The first thing you will need to do is create a Crystal report that is based off the History table as the primary table, i.e. a history detail report.  The standard reports in the system regarding history are not meant to be for a particular history record but instead reports showing all history for a given account, contact, etc.  You do not need to have any parameters on the report to define the History ID to use.  We will handle that in code.

Once you have your report created and added to the system, we can put together the code needed to invoke the report for a given history record.

Our modifications will all involve two files: HistoryList.ascx and HistoryList.ascx.cs.  Both of these files are custom smart parts.  You can find these in the application architect by navigating in the Project Explorer to”Portal Manager…Sage SalesLogix…Support Files…Smart Parts…History. 

 

Lets take a look at the ASCX file first.  In here we are going to do two things.  Change the mark up for the grid to add a couple columns.  Add a custom style to the page, and add a grid event definition.

Changing the markup for the grid:

 

The History grid markup contains the definitions for the columns that appear in the grid.  By default the column definitions of the grid look like this:

    <Columns>
        <asp:TemplateField HeaderText=”<%$ resources: HistoryGrid.Columns.Type.HeaderText %>” SortExpression=”Type”>
           <itemtemplate>
                <asp:HyperLink id=”A1″ runat=”server” Target=”_top”
                    NavigateUrl='<%# GetHistoryLink(Eval(“HistoryId”)) %>’>
                    <img alt='<%# GetToolTip(Eval(“Type”)) %>’ style=’vertical-align:middle;’
                        src='<%# GetImage(Eval(“Type”)) %>’ />&nbsp;<%# GetToolTip(Eval(“Type”)) %>
                </asp:HyperLink>
            </itemtemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText=”<%$ resources: HistoryGrid.Columns.CompleteDate.HeaderText %>” SortExpression=”CompletedDate”>
            <ItemTemplate><%# GetLocalDateTime(Eval(“CompletedDate”), Eval(“Timeless”))%></ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField=”User” HeaderText=”<%$ resources: HistoryGrid.Columns.Leader.HeaderText %>” SortExpression=”User” />
        <asp:BoundField DataField=”ContactName” HeaderText=”<%$ resources: HistoryGrid.Columns.ContactName.HeaderText %>” SortExpression=”ContactName”/>
        <asp:BoundField DataField=”Description” HeaderText=”<%$ resources: HistoryGrid.Columns.Description.HeaderText %>” SortExpression=”Description” />
        <asp:BoundField DataField=”Result” HeaderText=”<%$ resources: HistoryGrid.Columns.Result.HeaderText %>” SortExpression=”Result”/>
        <asp:BoundField DataField=”Notes” HeaderText=”<%$ resources: HistoryGrid.Columns.Notes.HeaderText %>” SortExpression=”Notes”/>
        <asp:BoundField DataField=”Category” HeaderText=”<%$ resources: HistoryGrid.Columns.Category.HeaderText %>” SortExpression=”Category”/>
    </Columns>

 

 

We want to add to additional columns at the very far right of the grid, so we will add our new column definitions after the BoundField column for Category.  The placement of the new columns is not required to be where I am placing them but be aware we do need to know the index position of our fields.  We will be using them in our code behind shortly.  Lets look at our two new fields in markup:

<asp:ButtonField ButtonType=”Link” CommandName=’Print’ Text=”Print”  />       
<asp:BoundField datafield=”HistoryId” Visible=”true”/>   

 The first line in our markup is a new Link button that shows the word “Print”.  The other column is the History ID of the current record.

 

 

Adding the custom style

The next thing we will do to the ASCX file is add some custom styles.  We want to add two particular styles.  One to hide the History ID column we added so the user does not have to see it, and one to add underlining to our “Print” column.  At the top of our ASXC page, immediately after the Register Assembly lines of code, we can add our custom styles, like so:

<style type=”text/css”>
    .hiddencol
    {
        display:none;
    }
    .bluecol
    {
        text-decoration:underline;                     
        color:Blue;
    }
</style>

 

Adding the new grid event

 

 

The final step in the ASCX file is to add a new event to the grid attributes.  These attributes are listed in the markup right before the columns definitions.  The standard attributes look like:

<SalesLogix:SlxGridView ID=”HistoryGrid” runat=”server” AutoGenerateColumns=”False” CellPadding=”4″ EnableViewState=”false” ForeColor=”#333333″
    GridLines=”None” CssClass=”datagrid” AllowPaging=”true” PageSize=”10″ AllowSorting=”true” CurrentSortDirection=”Descending”
    ShowEmptyTable=”true” EmptyTableRowText=”<%$ resources: HistoryGrid.EmptyTableRowText %>” ShowSortIcon=”true”>

 

We are going to add a new event definition for the grid’s OnRowDataBound event and the end of the other attributes, like so:

 

<SalesLogix:SlxGridView ID=”HistoryGrid” runat=”server” AutoGenerateColumns=”False” CellPadding=”4″ EnableViewState=”false” ForeColor=”#333333″
    GridLines=”None” CssClass=”datagrid” AllowPaging=”true” PageSize=”10″ AllowSorting=”true” CurrentSortDirection=”Descending”
    ShowEmptyTable=”true” EmptyTableRowText=”<%$ resources: HistoryGrid.EmptyTableRowText %>” ShowSortIcon=”true” OnRowDataBound=”HistoryGrid_RowDataBound”>

 

Now that we have finished modifiyng the ASCX file, lets go onto modifying the code file, the ASCX.CS.  In this file we are going to add our code for the new grid event we added for the OnRowDataBound event.  This code will do two things, set the custom style attributes of our new columns and add a client side click event for the “Print” column.  Lets see the code:

protected void HistoryGrid_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e)

{
    if (e.Row.RowType == DataControlRowType.DataRow)
    {
        e.Row.Cells[ 8  ].CssClass = “bluecol”;
        e.Row.Cells[9].CssClass = “hiddencol”;
        // Retrieve the state value for the current row.            
        String id = e.Row.Cells[9].Text.ToString();

        LinkButton btn = (LinkButton)e.Row.Cells[ 8   ].Controls[0];
        btn.Attributes.Add(“onclick”, “if (confirm(‘Are you sure you want to print this history record?’)){ShowReport(‘History:History Summary – Sample’,’History’,'” + id + “‘);return false} else {return false}”);
    }
}

A couple of things to note.  We have to refer to the columns by index position they appear in the grid. The index is 0 based.  If your columns are not the 8th and 9th columns you would need to change your code.  Also, the client side code utilizes the SalesLogix “ShowReport” function.  See more about the client side reporting library here.

Contact Customer FX for your CRM project
We let our expertise speak for itself - let us know how our all-star team can help on your CRM project
About the Author
Kris Halsrud
Kris Halsrud
Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Infor CRM SLX 10.0: Delegate Ownership Changes for “Everyone” Records

Learn how the new EveryoneOwnerAssignment secured action in Infor CRM SLX 10.0 allows designated users to change ownership of Everyone-owned records without requiring Administrator access.

Related Articles

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Related Videos