Updating Kinetic Dataviews with Event to Show Custom Field

Good afternoon,
This is my first time working on Kinetic dataviews. I am working on a customized version of the Kinetic Quantity Adjust Form. There is a grid called ‘Warehouse Bins’. This shows all the bins/lots that contain the part number that I entered.

I added a custom field to WhseBin called ‘Fullness_c’. I can query and update this field, so I know it exists.

I want to add this field to the Warehouse Bins grid on the Quantity Adjust form. The field is not listed when I try to personalize the grid.

So, based on a recent kinetic training course I took, I created a new event. It is an after event: ColumnChanged_SelectionPartNum. This fires every time I enter a new part number of the form. I confirmed this works with a simple dialog box.

Once the event is triggered, it links to a Rest-ERP widget. I believe the goal of this widget is to update the dataview for the grid holding the Warehouse Bins. I believe this view is called InventoryQtyAdjBrw. So I set the Rest ERP service to Erp.BO.WhseBinSvc, with the GetByID operation. For the method parameters, I set the warehouse code and the bin number to InventoryQtyAdjBrw.WareHseCode, and .BinNum, respectively. Lastly I went to ERP Rest Arguments > Response parameters, and added a new parameter called WhseBin, view: InventoryQtyAdjBrw, and parse from response path: returnObj.

I also added my custom column to the panel grid > grid model > columns. With a epibinding to WhseBin.Fullness_c.

After all that is setup, I believe the event of changing a part number should trigger the grid to be updated to show my extra UD field. However, this is not the case. Clearly I haven’t setup something correctly. I get a list of only the first bin in the list. But it is updating the fullness value correctly! I just want the rest of the bins/lots to show in the list like they normally do.

Can anyone help me work through the dataviews and this crazy REST stuff?
Thanks!
Nate

After fiddling a lot, now I only get an error result from the REST ERP action. I figured I would need to use the InventoryQtyAdjSvc, and GetInventoryQtyAdjBrw to repopulate the Warehouse Bins grid.

I just want to see my new UD field in that grid. But I can’t seem to figure it out. I have been all around the kinetic education courses and help files. I still can’t figure this one out!

I can’t seem to get any non-error result from the REST ERP widget in the event toolbox.
I have been through dozens of iterations trying to brute force the syntax.

For testing, I setup the REST ERP with a dialog for each of the potential outcomes. Success, Error and Empty. No matter what I try, I only get the Error output. I also can’t seem to get any details about the error.

I have been around and around trying to use the methods from InventoryQtyAdjSvc, and from the WhseBinSvc. I think I need to be using the Inventory one, and I think I need to use GetInventoryQtyAdjBrw, But I can’t seem to get the method to run without returning an error.

Any ideas?

Have you looked at the Dev Tools and/or the Event Viewer on the server to see what the error actually is?

No, I don’t believe I have access to that. On cloud dedicated tenancy.

You should have access to Dev Tools. It’s a function of the browser.

How To: Debugging Kinetic (Browser) - Experts’ Corner - Epicor User Help Forum (epiusers.help)

Gah! I haven’t used the browser at all. I have a hard time believing I should be working in a browser. I just hate it.

Do I have to build my customization in application studio, publish it, then open in a browser to use this kind of debugging? I haven’t published my custom kinetic form because I can’t get it to work in preview mode.

I typically just build it in app studio in the browser, then preview and open Dev Tools.

What doesn’t work when you try to preview?

I finally got the Quantity adjust to preview in a browser. I can see in the dev tools console there is a repeatable error being generated. I will try to copy/paste it here with some additional rows. I removed part numbers and https addresses.

0:
cancel: false
result:
data: {partNum: '(removed)', attributeSetID: 0, wareHouseCode: 'MSH'}
dataView: undefined
dirtyRows: undefined
erpBaqArgs: undefined
erpRequestMethod: "ErpPostWithDataViewProcessing"
erpRestPostArgs: {processResponse: true, responseParamArgs: Array(1), requestParamArgs: Array(0), fillExtendedProps: {…}}
methodParameters: {partNum: '(removed)', attributeSetID: 0, wareHouseCode: 'MSH'}
options:
convertTypesFromJson: true
headers: w {normalizedNames: Map(0), lazyUpdate: Array(2), headers: Map(0), lazyInit: w}
observe: "response"
showProgress: false
tableMapping: []
[[Prototype]]: Object
path: "GetInventoryQtyAdjBrw"
result: TypeError: Cannot read properties of undefined (reading 'toLowerCase') at ...(removed)
svc: "Erp.BO.InventoryQtyAdjSvc"
[[Prototype]]: Object
type: "EpRestActivity-onActivity"

The relevant part seems to be - Cannot read properties of undefined (reading ‘toLowerCase’). I didn’t use ToLower anywhere that I am aware of. Should I be looking somewhere else in the console?

So, I tried to replicate what you were doing, but was unable to trigger that error.
Can you verify your setup against mine?


REST-ERP widget:

image

image

image

image

1 Like

For this round, I setup mine just like yours. I still get that ToLower error when I trigger the event.

Do I need to change my InventoryQtyAdjBrw grid somehow? Where does my custom field get pulled into that dataview?

You would add it to the native InventoryQtyAdjBrw dataview like so:

Can you try wiring up the event to a button click to rule out your event as the issue?

I am confident my event triggers properly. I have tested it extensively with dialog boxes. Here is a screen capture of my REST ERP.
kineticevent

I still get the REST ERP resulting in error, pointing at the mysterious ToLowerCase.

Can you confirm you don’t have any method or data directive BPMs that are interfering?

Yes I am certain there are not method or data directives mucking things up.
How does the event know to fill in my Fullness_c field?

You generally have to tell it to. Since I didn’t read your original post properly, let’s start over (my bad).
First, add your column to the InventoryQtyAdjBrw dataview. You’re also going to create a new dataview for WhseBin (fill all fields with WhseBin).
Next, you’re gonna call the Erp.BO.WhseBinSvc rest-erp and within the response params, set the Param name to WhseBin, ViewName to WhseBin, and the path to returnObj.
Then you have to set up an iterative event with row-updates to take the data from the WhseBin dataview to the InventoryQtyAdjBrw dataview that has your new column.
This post outlines in a bit more detail: How To: Adding Columns to Existing Kinetic Grid - Experts’ Corner - Epicor User Help Forum (epiusers.help)

1 Like

Taking another look at this, I believe something you’re passing in or receiving back is null. “toLowerCase()” is a proper JS function that can be used, but if it’s trying to lower case a null value, then it’ll bomb. Something seems off with the dataview.

When you run it, can you go into Dev Tools and go to the network tab? Do you see a call for GetInventoryQtyAdjForPart? Does it have a response?

Yes, I see the response, and in it, I can see all the expected rows I would see in the grid. Although it is missing my Fullness_c field.

{returnObj: {,…}, parameters: {ds: {,…}}}
parameters: {ds: {,…}}
returnObj: {,…}
ExtensionTables: []
InventoryQtyAdjBrw: [{Company: "VTAERO", BinNum: "C", OnHandQty: 1, NonNettable: false, WareHseCode: "MSH",…},…]
0: {Company: "VTAERO", BinNum: "C", OnHandQty: 1, NonNettable: false, WareHseCode: "MSH",…}
1: {Company: "VTAERO", BinNum: "H1", OnHandQty: 1, NonNettable: false, WareHseCode: "MSH",…}
2: {Company: "VTAERO", BinNum: "H1", OnHandQty: 1, NonNettable: false, WareHseCode: "MSH",…}
3: {Company: "VTAERO", BinNum: "h1", OnHandQty: 82, NonNettable: false, WareHseCode: "MSH",…}
4: {Company: "VTAERO", BinNum: "h1", OnHandQty: 8, NonNettable: false, WareHseCode: "MSH",…}
5: {Company: "VTAERO", BinNum: "HFA", OnHandQty: 17, NonNettable: false, WareHseCode: "MSH",…}
6: {Company: "VTAERO", BinNum: "hfa", OnHandQty: 24, NonNettable: false, WareHseCode: "MSH",…}
7: {Company: "VTAERO", BinNum: "HFA", OnHandQty: 49, NonNettable: false, WareHseCode: "MSH",…}
8: {Company: "VTAERO", BinNum: "HFA", OnHandQty: 35, NonNettable: false, WareHseCode: "MSH",…}

Details for one of the rows:

0: {Company: "VTAERO", BinNum: "C", OnHandQty: 1, NonNettable: false, WareHseCode: "MSH",…}
AttributeSetDescription: null
AttributeSetID: 0
AttributeSetShortDescription: null
BaseOnHandQty: 1
BaseOnHandUOM: "EA"
BinNum: "C"
BinType: "Std"
BinTypeDesc: "Standard"
Company: "VTAERO"
ItemPCID: ""
LotNum: "VATESTLOT1"
NonNettable: false
NumberOfPieces: 0
OnHandQty: 1
PCID: ""
PartAttrClassID: null
PartNum: "(removed)"
RowMod: ""
SendToFSA: false
StkUOMCode: "EA"
StkUOMDesc: "Each"
SysRowID: "bd536ac1-93cc-4640-9df5-573f93375ef2"
WareHseCode: "MSH"
WhseBinDesc: "MS HARDWARE - C"

Okay, so first step is going to be to change it over to use the WhseBinSvc instead of the InventoryQtyAdjSvc and populate a new view called WhseBin.
Once done, validate through Dev Tools that WhseBin has a response, including your UD column.

1 Like