top N rows

How to Display Top N Rows in Creatio Using Detail Area

Creatio 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 Creatio, 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 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

November 18, 2019

That said, sometimes the problem isn’t that you’re not investing your money in a smart way, it’s that your business is losing money on extraneous expenses. These financial leaks can put a big dent in your budget over the course of a year, and might even prevent you from achieving your goals or executing your growth strategy. So today, let’s take a look at the five business leaks you need to fix, as well as some of the most cost-effective ways to invest back into your business to pave the road to success.

October 21, 2019

According to a recent study, 40% of people are working after 10 pm and 26% of work is completed outside of normal hours. Only a measly 2.8 hours per day is spent on productive tasks.

So, what are people doing with the rest of that time? Their days are consumed by checking emails, scheduling meetings, responding to chats, perusing social media, etc.