Kinetic updatable dashboard would not save record because

Spent entirely too long figuring this out today, but I did, so I wanted to share this for my future self and anyone else.

First, what are we calling this thing now? Updatable dashboard (still)? Kinetic uBAQ app? Well whatever it is…

In short

When you make one of these things, you have to include all key fields in the columns of the Panel Card Grid in Application Studio. (Or for Company, you will be fine if you use Constants.CompanyID inside the uBAQ.)

The story

We have an updatable dashboard that updates UD fields on the Part table.

Notice there are 5 sections. The first 2 would successfully update the data. The other 3 did not.

The frustrating thing was that all 5 sections run on the same updatable BAQ. So the BAQ was not the problem.

I was getting an error that indirectly was telling me that the dashboard was trying to add a new row to the Part table but failing.

After much distress, it dawned on me that it was trying to add part 724352 with a company ID of [empty string], rather than update the existing part in our real company.

Why?

Because the Company field was not in the list of columns for the panel card grid.

And since it wasn’t there, it wasn’t populated in the Data View.

And since it wasn’t populated in the Data View, the Event that runs from the save button did not send the company ID (well, it sent an empty string).

So rather than update the row, it was trying to make a new row (where the company ID was [empty string].

How to do this the right way

Option 1: Include all columns from the uBAQ (especially the PKs); hide any you don’t want to see, if desired, in App Studio.

Option 2: Code it into the uBAQ if you can. For Company, this is a gimme. Do this:

Did I have that at first? I sure did not! It came in as ttResult.Part_Company and I was perfectly happy with that. Well, now I know to change that to avoid extra work and heartache later!

In my defense, there was never a concern about this in the classic dashboard designer. If the column existed in the BAQ, it always existed in the dashboard. You could hide the column, but it was never not there.

Now I have to see it differently. I am making the Data View, so I have to supply all of the columns as needed.

6 Likes

@dcamlin @jwphillips Done now. Thanks for stanning though.

1 Like

Well done and well documented! Thanks for help us all out down the road!

1 Like

Option 3: Populate that data in App Studio in the save event

Heads up: this is probably a pretty dumb way to do this. Though, I have some thoughts about why someone might use it. I’ll cover it at the end. For now, this is just to show a concept.

First, I set my BAQ back to the original state where it wants Company to come from the result set.

Panel card grid does not have Company column, so the update fails since Company = [empty string].

But now I will shove a value into the Company field of the View via Row Update before I send the View back to the BAQ.

And that works.

(The pic shows “MyCompID” but you would use your REAL company ID, etc. No, it did not work for me with “MyCompID” - I used my real ID here but faked this pic.)

This occurred to me because someone told me recently that all fields of a View do not have to be populated:

What is the use case for this method?

Well I am not sure.

But perhaps the value you need is static from a combo box in the header of the panel card.

  • It is not so predictable as company that you can code it into the BAQ
  • But maybe it is something that will be the same over and over again in that session for the user.

For example, let’s say you need to transfer parts to a WIP bin. The “To Warehouse” and “To Bin” will be the same each time, but it’s not a value that was in the dataset when you retrieved the records. And it would be annoying to ask the user to enter it over and over.

EDIT: Oh, I can think of a real-life example. I have an updatable dashboard for count tag entry. The “Counted By” is not the entry person; it’s free text (you could put “Team E” or “Ahmed and Julia” or whatever). It’s annoying to have to populate that over and over. So I could put it as a text box at the top of the screen and then shove it into the uBAQ via a Row Update.

Also, to spell this out, “Row Update” updates the data in the selected row of the View, not the row of the database (or uBAQ).

2 Likes