On Leave Event in Kinetic?

I am trying once again to make Kinetic bend to my will. I have a great customization that works in classic. Part of it revolves around automatically populating some fields to help guide the user. For example, once the user enters a job number, the part number field becomes a drop down list of only the parts for that job. This is usually just one part, so the user can press the down arrow to select the first part and move to the next box, expediting data entry. I have the same drilldown approach for operation, and resource group.

These fields all work great with some custom BAQs to populates the drop downs, and I use an OnLeave event in each field to update the next field in the line. In classic the code is something like this:

public EpiUltraCombo cmbParts;

	private void txtMyJob_Leave(object sender, System.EventArgs args)
	{
		// ** Place Event Handling Code Here **
		if (txtMyJob.Text!="")  
		{
		epiDateTimeEditorC1.Value = DateTime.Now;
		getParts();
		cmbParts.ForceRefreshList();
		}
	}

	private void getParts()
	{
		cmbParts = (Ice.Lib.Framework.EpiUltraCombo)csm.GetNativeControlReference("6ed3c1b9-e6e3-4458-ba6e-b9f9e4b9434d");

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

		qeds.ExecutionParameter.AddExecutionParameterRow("job", txtMyJob.Text, "nvarchar", false, Guid.NewGuid(), "A");
	
		dqa.ExecuteByID("PartsForJob", qeds);
		if (dqa.QueryResults.Tables["Results"].Rows.Count > 0)
		{
			cmbParts.DataSource = dqa.QueryResults.Tables["Results"];
			cmbParts.DisplayMember = "JobAsmbl_PartNum";
			cmbParts.ValueMember = "JobAsmbl_PartNum";
			oTrans.NotifyAll();
		}
		else
		{
		MessageBox.Show("No Parts!");
		}
	}

So, now that I want to do this in Kinetic, what do I do? The behavior events for the text boxes don’t seem to show any OnLeave events.

I am trying to use Rowfilter on a combo box to replicate my classic functionality.

"Job = " +  TextBox-c38d0.Value

Thanks for your time!
Nate

Here I’ll raise the Kinetic Batgirl Signal for you. @hmwillett !!! :bat:

2 Likes

Lol, good one.

Take a few shots of vodka.

The “Leave Event” would be OnBlur.

image

Create two DataViews. One for your Jobs, then one for the related parts.
When the OnBlur event activates, use dataview-filter-set and filter the part DataView by the current job.

2 Likes

So the vodka raises the on-blur event? :thinking:

3 Likes

I wonder if that’s how Epicor created Kinetic? :thinking:

2 Likes

I heard it was Bourbon in Kinetics case.

1 Like

This sounds so easy! What is the datasource for my Jobs DV?
I think the datasource for my Parts DV would be my BAQ “PartsForJob”. Right?

What screen are you working in? The dataview for your jobs would be where ever that info is sourced from.
For the parts, yes–create a BAQView for your query.

Here’s some more info on that, however, it’s a bit dated. Let me play with the new stuff and see if there’s a more elegant way. BAQ Combo customization - how to convert from Classic to Kinetic - Kinetic 2021 - Epicor User Help Forum (epiusers.help)

I am working in a custom dashboard. The dashboard contains a BAQ that lists the contents of UD08. Ideally the user types in the job number as the start of the data entry process. I will keep playing with the dataviews on my end. Thank you for your help!

You wouldn’t need a view for it then. I was assuming you had two dropdowns.
If JobNum is just a textbox, then you don’t need to worry about a dataview for it. Just bind it appropiately–say TransView.JobNum or something.

1 Like

I just hate this experience so much! Nothing seems to be working, but there are no errors or anything to point me in the right direction.

I have a Job text box with ID: TextBox-c38d0 I have an OnBlur event setup that triggers a dataview -filter-set action. Dataview = MyParts, Filter = JobAsmbl.JobNum=TextBox-c38d0.Value. No EpiBinding.

I have a part combo box with ID: ComboBox-b4259. No EpiBinding.

I have a dataview for my parts, which is just a view of the PartsForJob BAQ.

The PartsForJob BAQ has a parameter for job number. I was filling in this parameter with custom code in my classic form. But I don’t see a way to do it here in Kinetic. The side menu keeps popping out asking me for a job number. I don’t want that. I just want to type it in the first text box.

So, something I can’t stand is the row filter on the combo only lets you filter from the bound dataset–not from others which would make this task SO much easier.

Try this out, instead:

Set up your view to receive the BAQ data:

Set up your combo:

image

Create your event for the textbox OnBlur:

Fill out the erp-rest widget:
image

image

image

{
	"ExecutionSetting": [
		{
			"Name": "Select",
			"Value": "JobMtl_PartNum"
		},
		{
			"Name": "Where",
			"Value": "JobMtl_JobNum='{TransView.JobNum}'"
		}
	]
}

2 Likes

You can either remove the parameter and do as I did or you can do the same steps, but add your parameter value in the Execution Settings instead of using the where clause.

1 Like

Here’s the syntax for adding a parameter:

{
	"ExecutionSetting": [
		{
			"Name": "Select",
			"Value": "JobMtl_PartNum"
		}
	],
	"ExecutionParameter": [
		{
			"ParameterID": "JobNum",
			"ParameterValue": "{TransView.JobNum}",
			"ValueType": "string"
		}
	]
}

I assume all the places you use the JobtMtl table I should be using the JobAsmbl table? As that is the table inside my BAQ. Right?

Correct.

I keep getting “Query with ‘JobPart’ id is not found…” My setup is just like the screenshots you posted. Should queryID under MethodParmeters by set to my BAQ ID “PartsForJob”? I removed the parameter from my BAQ.

“JobPart” is the name of my actual query. Change yours to “PartsForJob”.

I changed my queryID as I suggested above and now the Parts combo returns all the parts, not just the one I want.

Can I see what you set for your Execution Settings?