Adding a calculated field to a kinetic dataview?

Has anybody figured out to do this? I have gotten as far as adding a field to the OrderDtl dataview in Order Entry, and adding the field to lines grid, but I am trying to figure out the step where it gets populated with the result of a calculation. The kinetic user guide says it can be done but there isn’t much info to go on.

You’ll have to play with the proper event which will be different based on what you’re trying to do. At the very least, probably one event triggered after GetByID to populate the initial grid and then, depending on what the calculations are based on, possibly another event to recalc the grid if a field with calculation-dependent data is changed.

You would need to do the dataview condition iteration stuff outlined here: How To: Adding Columns to Existing Kinetic Grid - Experts’ Corner - Epicor User Help Forum (epiusers.help)

Yes I was actually trying to follow that example although its more complicated than what I need, but I got stuck on the matches dataview, I don’t know if its the version I’m using (2022.2) or I did something wrong but it said matches dataview could not be found.

It seems like you should be able to just put field a * field b as the binding for the field in the grid but of course its kinetic so why would it be simple?

When you define “matches” in the dataview-condition, it’s supposed to get created at runtime when the event runs and subsequently holds the data that matches the defined condition. If it’s barking–it’s possible you missed a step somewhere or misspelled something. Or gremlins. Never discount the gremlins.

Would be nice, wouldn’t it?

Ok if that’s the only way to do it I’ll give it another go, I probably missed something. Was just hoping there was a simpler way to achieve it.

It would be pretty sweet to have another property called “expression” where it takes whatever the field is bound to and applies the expression to it.

I tried to do a much simpler example of your method, since I don’t need to “go” anywhere to get the data (it’s already in in the OrderDtl dataview) and it worked - sort of. I must be missing something really simple yet not obvious to me because its populating all the rows with the data from the first row.




Change your row update to this: {matches.PartUnitWeight_c} * {matches.SellingQuantity}

Thank you!

1 Like

So here is a really strange problem. With these events in place, the lines grid is no longer editable - it triggers an error, “Order Header has not changed” when you try to click into the grid.

I’ve compared the trace in base to the custom layer and the problem is that the dataset_hasChanges event that fires when you click into the grid is now evaluating to true instead of false. I wonder if there is a way around this?

Sounds like a glitch to me as I can click into it without error after adding a calculated column similar to yours.

Could you share your events in case I did something differently?

Of course.

It may be a glitch but it keeps going away and coming back randomly, I think I will have to abandon this idea and wait for the grids to improve.

Amazingly Epicor support was able to reproduce the “glitch”. Now just have to wait and see what development has to say about it.

How TF did they replicate that??? I’ve never been able to consistently reproduce stuff like that in order to submit it to support, so I never bother. Hopefully something comes out of it!

After previewing the layer, load a sales order, click lines, then click into the selling quantity field in the lines grid. It happens every time.

Seems fine to me.

OrderCol

Tested on 2022.2.13–are you still on 2021.2?
Although, if support is testing it, they should be on the latest… :thinking:

I guess it’s not an apples-to-apples test as my calculated field is using SellingQuantity * DspUnitPrice since I don’t have the UD field you’re using, but I wouldn’t think that would matter.

I’m clicking the lines link in the left nav that brings up the the lines page, not scrolling down to the liens grid. Don’t know if that makes a difference. 2022.2.14.

Huh.

Well there ya go! lol…