Adding Columns to Existing Grid in Kinetic

In many cases, it might not be!

There appear to be three main ways to add columns to a grid:

  1. The data is already in the set: just add the column… but if the fields aren’t already there, then no luck, right?

  2. Create a BAQ with all the columns, plus the added columns, and basically make it from scratch … but this sometimes doesn’t play nice if it needs to interact with other elements on the screen.

  3. Some finesse with a BAQ and some events to hack it together in the UI. (Thank you, @hmwillett!)How To: Adding Columns to Existing Kinetic Grid … but sometimes the events don’t fire when expected, or there are apparently no appropriate events to use.

So what if you could just add the fields to the dataset that is already coming back?
It turns out that you can!

We hired a consultant for help with this … ridiculous. He showed us that it can be really simple.

Step 1: Identify the BO method that is used to populate your grid
In this case, it was ARInvoice.GetRowsCustomerTracker

Step 2: Create a Post-processing directive and add the field to each row of the result dataset
Here’s the code we wrote:


If there are any rows, I grab the additional fields from the database up front in a single query (along with the key fields so I can match the data to the row it belongs in). Then for each row in the dataset, add the new field (or fields). You can see here that I have added UD Field Character01 and gave it the name “ARCode” - you can name it whatever you want (stick to alphanumerics, of course).

Step 3: Add the field to the grid columns.
Use the field name you gave it in your code - ARCode in this case.
image

That’s it.
image

Obviously, not every solution fits every situation, but I’ve customized several grids since learning this method two days ago - instead of fighting with events and remaking whole sections of screens. If you can, use what is already there!

5 Likes

That is cool. I’ll have to try it.

Thanks!

Joe