Data Entry Form in Kinetic

This seems to work:

'{TransView.myPartNum}' !== 'undefined' &&  '{TransView.myPartNum}' !==''

So now that I have a condition that evaluates properly, I need to update the rev combo box using the value in myPartNum. The BAQ that feeds the rev combo box requires a parameter that I passed in classic using:

DynamicQueryAdapter dqa = new DynamicQueryAdapter(oTrans);
		dqa.BOConnect();		
		QueryExecutionDataSet qeds = dqa.GetQueryExecutionParametersByID("getPartRev");
		qeds.ExecutionParameter.Clear();

		qeds.ExecutionParameter.AddExecutionParameterRow("part", MyPartNum.Text, "nvarchar", false, Guid.NewGuid(), "A");

I looked at the “combo-refill” component, and the “property-set” widgets. But I can’t tell how to pass a parameter to my BAQ and refresh my combo box.

You shouldn’t need an event to filter a baq combo by other fields, it can be done completely using the control fields available.
There is a good writeup in the App Studio help files under Component Reference / Combo.
Component Reference and Examples – Kinetic 2022.1 (zendesk.com)

I would much prefer skipping the actions and conditions if possible! I read that help article. Based on that I setup my combo like this:

erp-combo-box
ID = myRev
Label = Revision
epBinding = TransView.myRev
reusable combo filter = PartNum = '?{TransView.myPartNum}'
advanced baq query = getPartRev
advanced text field and value field = PartRev_RevShortDesc

When I enter a value in part number, and look at the results in the rev combo, the rev combo is always empty.

I got a little farther. I was able to get something to populate in my combo box. But the BAQ is returning all revs instead of just the revs for the entered part number. I changed the following:

  1. Removed the criteria and parameter for part number from my getPartRev BAQ.
  2. Changed combo box filters to: PartRev_PartNum = ‘?{myPartNumCol}’
  3. Changed combo box FiltersParams to: myPartNumCol =?[PartRev_PartNum]

Why is my filter not… filtering?

First, under advanced / columns, add your BAQ fields, PartRev_RevShortDesc and PartRev_PartNum.
Then, set your filters / hidden column append under reusable combo to the following values:
Hidden Columns Append - PartRev_PartNum
Filters - PartRev_PartNum=‘?{PartNumCol}’
Filters Params - PartNumCol=?[myPartNum]

It should look like this

1 Like

That did it! I came upon this solution through trial and error just as you posted it! Man, this syntax is a pain! What language even is this?

Yea, the syntax sometimes can be annoying.
Kinetic is basically Angular with Kendo controls, the syntax follows that.

2 Likes

The complexity just keeps increasing! Now my next combo box has multiple criteria. In my original BAQ the parameters were in the sub-query criteria. I removed the parameters and the criteria. It was previously:

PartRev_RevShortDesc = myRev AND (JobHead.PartNum = myPart OR JobAsmbl.PartNum = myPart)

So I followed the instructions and setup the filter for the combo:

PartRev_RevShortDesc=‘?{RevCol}’,  JobHead_PartNum=‘?{PartCol}’,  JobAsmbl_PartNum=‘?{PartCol}’

The filterParams for the combo: RevCol=?[myRev], PartCol=?[myPartNum]

But this doesn’t seem to return any results. I am also not sure how to represent the AND and OR statements in my filter.

I don’t think you can use the filter params / filters with OR conditions, only AND.

There is probably several ways to handle it, the first thing I can think of is to modify the BAQ.
Change the BAQ to just query JobAsmbl, joined to PartRev, and display JobAsmbl_PartNum, JobAsmbl_JobNum, PartRev_RevAltMethod.

Then your filters are PartRev_RevShortDesc=‘?{RevCol}’, JobAsmbl_PartNum=‘?{PartCol}’
and your filterParams stay the same.

Assembly 0 from JobAsmbl is the top level assembly, its the same Part as JobHead.PartNum so the filters end up working the same without using an OR.

1 Like

That’s a good idea! I didn’t think about tweaking my BAQ. You really can’t do OR statements? That seems like a bit of an oversight, no?

Alternative approach, you could save the results of your query into a dataview, use the dataview-filter-set widget to filter your view by the conditions you would have set in the combo filter, and set the ‘View Name’ of the combo to that new view.

Or something like that. :woman_shrugging:

I think you mean the results of the query that populates the next combo box. Do I just setup a dataview pointing to my BAQ, and then do that dataview-filter set thingy? How do I write the syntax for the filter criteria in that thingy? The goal is to filter the BAQ “getPartRev” by part number and put all the returned revisions in the combo box. The BAQ has part number in it, along with rev and a short description. The combo should store the rev and display both the rev and short description if possible.

I did some googling on Angular, and Kendo. Trying to find any examples of syntax so I can see how these dumb kinetic expressions are supposed to look. I can’t find anything that looks similar to the syntax we are using in these filter expressions. Do you know of any syntax references?

If you turn on tracing (F12 in Chrome and Edge), you can see the syntax of the screen coming down to you. When the client requests a page, it calls this REST function:

https://<server>/<instance>/api/v1/Ice.LIB.MetaFXSvc/GetApp

It will return a huge @ss JSON response. Copy it, paste it into VS Code, save as a .JSON file, right click the text, and choose format document. You’ll get pretty version of what the META FX format is like and you can view the how the pizza is made.

Works for cloud and on-prem users. :wink:

2 Likes

Where do I find this JSON? In the dev tools there are tons of menu options.

1 Like

On the Network Tab, click on the line that says, “GetApp?request=…”

The Payload tab shows what’s going to the function:

{
    "id": "Erp.UI.JobEntry",
    "properties": {
        "deviceType": "Desktop",
        "layers": [],
        "mode": null,
        "applicationType": "view",
        "additionalContext": {
            "doValidation": false,
            "menuId": "JCGO3003"
        },
        "debug": false
    }
}

And the Response tab is where you pick up the JSON:

image

Don’t let the one line fool you, that’s about 50K+ lines when you format it in VS Code. Click on the text, Cntrl-A, and copy it. Then paste into your JSON-friendly editor of choice.

3 Likes

This is neat, but it doesn’t help me figure out the filter expression syntax. What can and can’t be in the filter expressions? What do all the symbols mean? How do we combine multiple criteria in the expression? There are lots of questions I think I can answer myself if I just had something, anything for syntax reference. Surely Epicor is not just making this stuff up as they go along!?

2 Likes

They’re not. Some syntax is dictated by the Kendo controls but other is designed by Epicor.

Search that JSON file for Filter and Expression and you start to see patterns:

Something surrounded by ‘%’ is a replacement for local variables

"validateFilter": "QuoteNum = '%value%'"

Items in braces are the values for dataviews. Values in single quotes are strings and numbers are not:

"preLoadSearchFilter": "Plant = '{Constant.CurrentPlant}' AND JobType != 'MNT'",

Just hack around a bit… :wink:

2 Likes

Here is a section from the Inventory Transfer Form when getApp runs. I am looking at the “filters” syntax here:

                                    "tableName": "UOMConvList",
                                    "filters": [
                                      "Active=True",
                                      "UOMClassID = '?{UOMClassIDColName}'",
                                      "PartNum = '?{PartNumColName}'",
                                      "TargetUOMCode = '?{TargetUOMCodeColName}'",
                                      "StockOnly = ?{StockOnly,false}",
                                      "UOMClassID = ?{UOMClassID}",
                                      "RetrieveAll = ?{RetrieveAll,false}"
                                    ],

Why do some have single quotes around them, and others do not? Why do some expressions have more than one parameter (see RetrieveAll)? Do all these filter criteria get applied using AND?

Generally, the single quotes are for strings… not sure what the deal is with UOMClassID, though.
The bools have a second param for a default value if the actual variable is null. I’m pretty sure you can do that for other fields too, but I have not really played with that aspect.

Yes.

1 Like