Data Entry Form in Kinetic

So looking back at my Jobs combo box, I see this in the response JSON:

"model": {
                          "guid": "5897b8c4-e9e0-4b69-a2c2-075a2295b051",
                          "labelText": "Job Lot",
                          "id": "myJobLot",
                          "epBinding": "TransView.myJobLot",
                          "isKeyField": false,
                          "queryId": "Jobs",
                          "textField": "JobHead_JobNum",
                          "valueField": "JobHead_JobNum",
                          "filters": [
                            "\"JobAsmbl_PartNum=‘?{PartCol}’",
                            " PartRev_RevisionNum=‘?{RevCol}’\""
                          ],
                          "filtersParams": [
                            "\"PartCol=?[myPartNum]",
                            " RevCol=?[myRev]\""
                          ]

Those \ slashes are not in my expression, but they show up in the response. I have tried at least a dozen variations for my filter. Most of the time the Jobs combo just returns all jobs. I have never been able to get it to filter by both the part number and the revision.

Remember that you’re looking at JSON, so the whole part to the right of the ‘:’ is the expression. In this case it’s a string. It is not a part of what you’ll see in App Studio. To put a double quote into a string that is already surrounded by double quotes, you have to escape the character. The back slash tells the parser, “Hey, the next character is not a delimiter. Treat it as a double quote.”

1 Like

I can get the combo box to filter by part number, but not by both part and rev. This works:

filters: JobAsmbl_PartNum = '?{myPartNumCol}'
filters params: myPartNumCol =?[myPartNum]

But this returns the same job numbers regardless of which rev is choosen:

filters: JobAsmbl_PartNum = '?{myPartNumCol}', PartRev_RevisionNum = '?{myRevCol}'
filters params: myPartNumCol =?[myPartNum], myRevCol =?[myRev]

How can I get the combo to use both filters?

I seem to recall ‘AND’ works in the filters, but you don’t need it in the filter params. I could be making things up, though. :sweat_smile:

I have tried plugging AND, and && in various places. Still can’t filter by more than one criterion.

Don’t get all fancy on me now. :rofl:

3 Likes

Set up the dataview for your BAQ and create an event that fires on the previous combo’s value changing to populate the new view. You can use the erp-baq widget and send in your params with a where clause or bring it all back and use dataview-filter-set.

Syntax:

Part_PartNum = '{KeyFields.PartNum}' OR Part_PartNum = '10061'
1 Like

I have been trying various methods this morning to get this working. I tried using the erp-baq widget and the dataview-filter set. I couldn’t get either to work.
In debug, I can see that the filter worked on the dv:

columnChanged: myRev_onBlur actions: [dataview-filter-set, combo-refill]
action: dataview-filter-set param: {dataview: 'dvJobLot', filter: 'JobAsmbl_PartNum = {TransView.myPartNum} AND JobAsmbl_DrawNum = {TransView.myRev}'}
dataview:"dvJobLot"
filter:"JobAsmbl_PartNum = 10062518 AND JobAsmbl_DrawNum = PP02"
[[Prototype]]: Object

So, it looks like the dataview was updated. However, using ctrl+alt+v, I can see that the dvJobLot has no data in it. As expected, my job combo also does not list any results.

The expression for my dataview-filter-set is:

JobAsmbl_PartNum = {TransView.myPartNum} AND JobAsmbl_DrawNum = {TransView.myRev}

And you can see in the debugger this validates to a real part number and revision number. But the filter never seems to change the contents of the dataview or my combo box.

My combo box is setup like this:

id: myJobLot
data > epbinding: TransView.myJobLot
reusable combo > viewname: dvJobLot
reusable combo > view column name: JobHead_JobNum
Advanced > no settings

EDIT:
I also tried adding this with the same empty results.

Advanced > BAQ Query: Jobs
Advanced > TextField/ValueField: JobHead_JobNum

Ohh! I got the erp-baq to return all the job I expected. However, only the first job shows in the combo box. I can see the other jobs in the debugger, but they don’t show in the combo box as options:

returnObj: [,…]
0:{Results: [{JobHead_JobNum: "31243/1", JobAsmbl_PartNum: "10062518", JobAsmbl_DrawNum: "PP02",…},…],…}
Errors:[]
ExecutionInfo:[{Name: "ExecutionTime", Value: "12.7633"}]
Results:[{JobHead_JobNum: "31243/1", JobAsmbl_PartNum: "10062518", JobAsmbl_DrawNum: "PP02",…},…]
0:{JobHead_JobNum: "31243/1", JobAsmbl_PartNum: "10062518", JobAsmbl_DrawNum: "PP02",…}
1:{JobHead_JobNum: "31243/2", JobAsmbl_PartNum: "10062518", JobAsmbl_DrawNum: "PP02",…}
2:{JobHead_JobNum: "31243/3", JobAsmbl_PartNum: "10062518", JobAsmbl_DrawNum: "PP02",…}
3:{JobHead_JobNum: "99999-9", JobAsmbl_PartNum: "10062518", JobAsmbl_DrawNum: "PP02",…}

I need to come back to the Jobs combo. I can’t seem to get all the results to display there.
Moving on, I now have TransView full of the data that I want to push back into my UD_09 table. In the past I did this with a uBAQ, and a custom action.

My button was added to the dashboard grid panel using Action Data… Now that I have a button, an action and the data, how do I get it all together and ship it out to UD_09? Can I push the data from TransView into my callcontext variables?

Sure, CallContextBpmData as a view exists in all the kinetic forms.
You use a row-update widgit in an event, then go to parameters / columns and add a column for each mapping.
The syntax is EpBinding ( The view / column being set ) - CallContextBpmData.Character01
Value = “{TransView.myPartNum}”

2 Likes

I don’t see it listed in the dataviews tab, or in my debugger (F12, Ctrl+Alt+V). Is it just hiding there in the background?

It doesn’t show in the dataviews tab but it is under System Dataviews when you Ctrl+Alt+V. System dataviews are above the Application Dataviews and does not expand when you use that hotkey, it can be easy to miss.

2 Likes

So, I want to add a button to trigger this event. I already have actions in my UBAQ BPM. What’s the right way to add the button, insert this event, and then trigger the custom action in the uBAQ?

Thank you all for your help in getting me this far.
I got callcontext populated with my data. Now I need to trigger the custom action from my UBAQ BPM. I think I need to use the erp-baq widget to set the BAQ. I am not sure what settings to use in the widget. Do I need BAQ Execute Options? Do I need to change the mode from get to update? How do I pass in the actionID to my custom action?

Nevermind! I think I got it! I see once you change from get to update, the rest of it is obvious! I am just not sure about the View Name to use in the erp-baq widget.

I ended up using the view UD_OpenJobInventory_0_0.

It is working well. I can add records to my UD table, and I can delete them. Both using custom buttons. I did not end up using the Action Data… to add buttons, that never worked right.

My delete button is working to remove the record. But everytime I click it I get a record not found error. The records still gets deleted, so I am not sure what the issue is. Can you tell from this what is causing the error?

erp-rest-service [post] 404 - OK Http failure response for https://centralusdtpilot01.epicorsaas.com/saas512pilot/api/v1/Ice.BO.KineticErpSvc/UpdateBaqCustomAction: 404 OK; {"HttpStatus":404,"ReasonPhrase":"REST API Exception","ErrorMessage":"Record not found.","ErrorType":"Ice.Common.RecordNotFoundException","ErrorDetails":[{"Message":"Record not found.","Type":"Error","Table":"UD09","Program":"Epicor.Ice.dll","Method":"OnDeleteByID","ColumnNumber":17,"LineNumber":819}],"CorrelationId":"c59eaf63-2efb-4647-b9e7-90078e098783"}
Business Layer Exception

Record not found.

Error Detail
============
Correlation ID: c59eaf63-2efb-4647-b9e7-90078e098783
Description: Record not found.
Program: Epicor.Ice.dll
Method: OnDeleteByID
Table: UD09
Field: undefined

I would like to clear my data entry form after adding a record. I added the data-clear-dataview: for TransView after my event. It looks like to clears out most of the fields. However, my quantity field does not get cleared. The previous value stays in there. Is there another way to clear the values in my controls? All of the controls are bound to TransView, including the Qty field that won’t clear out.

I had to add event-next widget with Event Id = SysInitTransView. That seems to have cleared out all the fields like I expected.