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.