Office 365 and SharePoint – Sales Contract Lifecycle Management (CLM) – Search Refiner Date Managed Properties and Display Templates

We’ve already agreed that Search is going to be a key part to your business management system in Office 365 and SharePoint. In this post, we mapped our crawled Expires Date property to the Managed Property named RefinableDate00. We then used that refiner date to customize the Search Results on our Sales Contracts Quick Search page with the “Two Lines” Display Template. That’s shown in the first image below. Also called out in that post: for the Contract Lifecycle Management (CLM) system, the dates were not in the right format because they included a timestamp.

Business Management O365 SharePoint contracts sorted by expiry.

The Sales team was not happy with that time stamp (e.g. “07:00:00 AM”) showing up in the results. When they created the Expires Date field, they created it as a “Date Only” field because time is irrelevant to the expiration date of a sales contract. Also, not everybody is familiar with the design of the page, so without a label like “Expires: ” before the date/time value, a user won’t necessarily be able to determine exactly what that date represents. In this post, we’re going to fix that date to be a standard US-English date format without a time stamp, and we’re going to get a label in the results as well.

To be clear, this is a pretty advanced post if you’re a business user. I have full confidence in your ability to understand what’s going on here even if you don’t usually get into the technical weeds, but executing the kind of updates that are going to be demonstrated will require modifying a couple of lines of HTML and writing a small amount of JavaScript to reformat the date. Read on for the knowledge, make the updates if you’re comfortable doing so, and if not….ask questions in the comments section, and I’ll try to clarify exactly what’s going on in this post. Finally, to make this post as clear as possible, I’m stepping outside of the “perspective of the scenario”; I’m not writing content from the viewpoint of Sales or a business division.

Reviewing the Refiner Managed Property RefinableDate00

Something to note about the RefinableDate00 managed property that we created here: I also added an Alias value to the Managed Property definition so that I can refer to “RefinableDate00” as something more identifiable when its used in scenarios like the one covered herein. Later on, when I use “ExpireDateRefinable” in the Search DisplayTemplate…this is why:

Creating the new Display Template for the Contract Lifecycle (CLM) Search Results

As with many posts in this series, I have to assume you’ve followed along. Here, my assumption is that you enabled the Publishing Infrastructure as we covered in this post. If you didn’t, the Master Pages gallery you’re about to see will not look the same. So, here’s what I’m going to do:

  1. Go to the Master Page gallery.
  2. Navigate into the Display Templates used for Content Search Web Parts…because the Sales Contracts Quick Search page is based on a Content Search Web Part (CSWP).
  3. Locate the Display Template used for “Two Lines”…because that’s what we chose when setting up the quick search page.
  4. Download that template.
  5. Fix it up to have a reference to the RefinableDate00 (a.k.a. ExpireDateRefinable) property so that I can use that property in my custom HTML.
  6. Write some JavaScript to manipulate and reformat that date value into what we want: an English-US date format with no time stamp.
  7. Write the custom HTML that outputs the new date how we want…with a label in front of it.


Applying the new SharePoint Search Display Template

Now, it’s time to:

  1. Upload the new Display Template.
  2. Publish the template.
  3. Reset the CSWP properties on the Contracts Quick Search page (to use our new template).
  4. Validate the results.


Of course, you can repeat this pattern to add additional important fields.

  1. Promote the crawled property to a managed property.
  2. Pull the managed property into the SharePoint Search Display Template by adding it to the ManagedPropertyMapping XML element.
  3. Pull the value from ctx.CurrentItem.
  4. Validate/manipulate that value.
  5. Output it into the Display Template.




Categories: Business, Business Management, Contract Lifecycle Management, Office 365 and O365, SharePoint

Tags: , , ,

2 replies


  1. Office 365 and SharePoint – Sales Contract Lifecycle Management (CLM) – Calendars with Search Web Parts and Calculated Event Date Filters – Westmorr Consulting
  2. Office 365 and SharePoint – Human Resources (HR) – Company Directory and People Finder with SharePoint Search and User Profiles – Westmorr Consulting

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: