Creating a Part Search for BAQ

So on your feeder query, you make a list of what you will need for the parameters. Then use properties, and check on the field that you want to publish.

On the receiver query, go the the parameters tab, and select the parameter, and make it equal to the field that you published.

Here you can see that it changes and you change rows.
parameterrefresh

So this isn’t ideal, as the query probably takes a little bit in your case, and it will refresh everytime you click on a different row, but it gets rid of the popup. I’m not really sure which is better.

When you’re new, it’s all about a lack of knowledge. I still feel new.

It shouldn’t be too hard to combine @aarong’s & @Banderson’s approach together.
It won’t be too hard to adapt

Yea, I don’t think this will work, as it takes out all my functionality in searching for multiple parts, and the refresh would be highly annoying.

I think that’ll work nicely. He just needs to use the partsearch bit to filter a simple query of parts, and
then feed the lower query.

Maybe I need to start looking at the lesser of two evils here…

Have you ever read into this at all? Would it be possible to use this in a grid within my dashboard, and just use my text box as the paramaters it calls?

Also, I’m not sure if we have different versions but mine doesnt look like that in dashboard?

Ah, damn. I didn’t take the time to look at your version. Yeah, that’s a newer improvement.

Ok so I think I might take this in a different direction here.
If I create a BPM Form, can I call out the BAQ and return a table?

I have this so far, which I think works?

// **************************************************
// Custom code for IP_IndentedBOM
// Created: 1/17/2023 10:04:29 AM
// **************************************************
using System;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
using Ice.BO;
using Ice.UI;
using Ice.Lib;
using Ice.Adapters;
using Ice.Lib.Customization;
using Ice.Lib.ExtendedProps;
using Ice.Lib.Framework;
using Ice.Lib.Searches;
using Ice.UI.FormFunctions;

public class Script
{
	// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
	// Begin Wizard Added Module Level Variables **

	// End Wizard Added Module Level Variables **

	// Add Custom Module Level Variables Here **
	DynamicQueryAdapter dynamicQueryAdapter;

	public void InitializeCustomCode()
	{
		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
		// Begin Wizard Added Variable Initialization

		// End Wizard Added Variable Initialization

		// Begin Wizard Added Custom Method Calls

		// End Wizard Added Custom Method Calls
		dynamicQueryAdapter = new DynamicQueryAdapter(IP_IndentedBOM);
		dynamicQueryAdapter.BOConnect();
	}

	public void DestroyCustomCode()
	{
		// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
		// Begin Wizard Added Object Disposal

		// End Wizard Added Object Disposal

		// Begin Custom Code Disposal
		dynamicQueryAdapter.Dispose();
		// End Custom Code Disposal
	}
    private void IP_IndentedBOM_Load(object sender, EventArgs args)
    {
        string myPartNum = "QS-REF-02AP2";
        QueryExecutionDataSet queryExecutionDataSet = new QueryExecutionDataSet();
        queryExecutionDataSet.Tables["ExecutionParameter"].Rows.Add("PartNum", myPartNum, "nvarchar", false, null, "A");
        dynamicQueryAdapter.ExecuteByID("IndentBOM", queryExecutionDataSet);
    }
}

I just need a way to return the results in a table view. The guide I’m following doesn’t really explain how to do that, just gives me the overall “result”.

dynamicQueryAdapter.QueryResults.Tables["Results"]

From there I’m assuming I can just use a textbox as the string that gets sent along with the BAQ?

You mean like this?

There are SO many directions you can take to accomplish this.

Yea I would assume so. I just thought a dashboard would be the easiest. I guessed wrong lol. Epicor makes everything so difficult!

Have you tried using “like” in your filtering when you put in the parameter? You can make an expression that adds in the wildcards that you need.

For parameters it simply does Part_MtlPart MATCHES @PartNum paramater

I was able to get this working now with a BPM Form. Thanks for all of your guys help with this. Hopefully in the future I will get to use all this new knowledge!

I wish I could mark all of your answers as a solution! As my original question was only about the Part Search portion, I’ll mark the code to get a button with a quicksearch working as the solution. But you all have been a great help!

1 Like

There’s something in here for everyone! :tada: