Obtain dataset or record from base / out of the box search

Hey Everyone,

For any base search function in Epicor, AKA user clicks a button on a non customized screen to bring up search…is there a way to hook in to that via a customization to grab the record they choose? Or can we only grab the result by making a custom search?

Thanks!

Ive tried everything to grab the results from an out of the box search to no avail :frowning:

I’m not sure exactly what you are after. It’s possible to replace the button with your own and do something with it. Otherwise custom search, like you said. I’m not sure if that includes calling an advanced search in which a dashboard that you make replaces the normal search function.

Do you have more details of what your end goal is?

Instead of having to use:

string whereClause = String.Empty;
		bool recSelected;
		DataSet partSearch = Ice.UI.FormFunctions.SearchFunctions.showLookup(this.oTrans,"PartAdapter", out recSelected, false, false, whereClause);
		
		if (recSelected)
		{
			development.DataSource = partSearch;

Then manually update everything after that to get that search dataset, I just would like to hook into the dataset that the base search already returns on a base search button aka supplier , sales order , etc.

So you aren’t actually looking for the results, you are looking for what they used to search with?

I’m looking for the returned data set of the record they select. I can get that when implementing above, but then I have to manually update the UI with the record. There has got to be a way to access the resulting record dataset from just a base search from a base button that does the EpiMagic updating the UI with the chosen record. I’ve gone into the plumbing trying to find any method that can grab a dataset to no avail. Process Caller, the transaction itself, lots of stuff.

I mean the resulting result will end up in the adapter.
What’s the end goal?

I tried grabbing the result from the adapter too using both getCurrentDataset and getSearchDataset.

I just want to grab a part number from the search to run a dynamic query on it. And I’d like to do that without having to override the base search button for a part.

Why don’t you just get it from the data view?

Because I need the check to run before the data is saved or even gets to the data view level.

So 1. User clicks base search button
2. User selects record
3. Dynamic query is then ran with their selected record

A query is ran with their selected record? Can you give us more insight into what you are trying to do?

Have you tried a BPM on the search method? (I have no idea of that will do what you want, but maybe worth a try)

I still can’t wrap my head around why you need this.

Why don’t you use a baq data view? You can subscribe the baq dataview to the partnunber field and the. Epimagic will automatically run the baq for you with the right filter

Thanks guys, and sorry for dragging this on but here is what I’m still stuck on. I know I could move this to a different event or method on Update: but there has to be a way to grab the part here
Jose, this is what I’m after:

What you are trying to accomplish there should be done doing a BPM.
You can easily do this on there. Is there a reason not to?

I mean there are adapter methods you can grab a hold off. On after GetByID or even on Before GetByID could do it.
But really you should catch it in a method directive

I’ll give the BPM way another crack tomorrow. I couldn’t get it to run the Dynamic Query BO last time I attempted it but maybe my mind was just gone at that point haha.

And I’m trying to keep validation client side as we have too many redundant BPMs that can also come into play with our integrations calling methods as well. So I try to keep things at that level as minimal as possible. In this example we would only ever worry about it for manual entry that’s why I decided to do it here but at this point probably easiest to do it there :slight_smile:

Do you have to have a dynamic query? (I haven’t gotten them to work either) Can’t you just make a BPM query?

You shouldn’t need to run a BAQ from the BPM you are already in the server just run a linq query

Bingo. That was my fault hahaha. How did I forget that?? 🤦🤦🤦 wow. And I’ve even read that on here too. Sighh. Margarita time.

1 Like

GOT IT!!

I couldn’t use a bpm on the change part num method as on that route I had no access to the current order num and customer num to query for that attribute.

All I did was make a new basic search using the simple search wizard for a part, and linked that to a button that replaces the base part srch button. Added a top lvl variable to store the part num from the search adapter row , passed that into my code, and off we went :slight_smile:

Overriding the base search was ALOT simpler than I thought it was going to be lol

bam