top N rows

How to Display Top N Rows in bpm'online Using Detail Area

Bpm'online has a quick and easy way to build a detail area (a.k.a. one-to-many relationship). You've probably already tried using the detail wizard and bpm'online auto-magically generated the functionality for you behind the scenes. So easy!

Let's take that one step further. Let's use Wonka Industries as our example. Wonka Industries wants to be able to see the top three years of revenue by each client to determine the company's sweetest years with that client. The revenue is tabulated and available in bpm'online, but Wonka wants sales reps to see only a snapshot display of the top three years.

So, we must use a little bit of code to accomplish three tasks:

  1. Sort the data by revenue so the highest revenue years show up first
  2. Add a limit so only three revenue records show up at once
  3. Remove the "Load More" link so a user doesn’t think they need to click, therefore receiving unnecessary data

Let's start with the basics. Use the detail wizard and you will get a result like below. All the data associated with this account is displayed.

bpm'online top N rows example 1

Now we add the code to specify what we want to display:

And just like that, the detail area is filtered to display only the top three rows. 

bpm'online top N rows example 2

Allen D'Souza's picture
Allen D'Souza
Senior CRM Consultant

Allen is a senior CRM consultant at Technology Advisors Inc. He spends most of his time designing solutions using InforCRM, StarfishETL, and SQLServer. He also specializes in data migrations from-and-to Microsoft Dynamics CRM and Salesforce.com. Allen has been involved in large implementations for prominent players in the real estate, telecom, manufacturing, and publishing industries. Prior to working at Technology Advisors, Allen worked as a Microsoft application developer in the Accounting space. Outside of work, he likes to meditate, play his guitar, and eat chocolate.

Related Articles

June 27, 2019

Did you know the subscription level of your Sugar Cloud instance dictates your data storage capacity? If you didn’t know, you probably haven’t hit your data limit; but you may be closer than you think! If you exceed capacity, you could be charged fees. No one likes fees.

So, let’s consider some key aspects of your Sugar storage:

June 18, 2019

When you make the choice to utilize email marketing campaigns to boost your ROI, the easiest method involves two simple steps:

  • Ensure that your emails reach your customers’ inboxes.
  • Provide high-quality content that is mobile-ready and a good read.

The power of email messaging goes much deeper than you might think. Statistics show that 90 percent of emails make it to a customer’s inbox, while only two percent of ads make their way onto an individual’s Facebook newsfeed.