Trying to use a BAQ search-show to fill data fields

Reposting this here to separate it from a necro-thread.
My use case is simple:
Use a field lookup event to find a ship-to address and populate fields with the CustID, ShipToNum and Name.
Straight use of the ShipTo table doesn’t return the CustID; it only returns the CustNum.
Therefore we use a BAQ.


I link the BAQ to the onClick event for the field and away we go.


The search-show is setup:


and returns thousands of records into ErpSearchResults dataview when executed.
That’s expected but annoying. (A selected column that returns would be nice)
The dataview-filter-set widget uses the searchResult dataview to restrict the results to just the one I’m looking for.

Ta da. Just the one row I need with all the data I need.


Now I just need a row update to copy the data from ErpSearchResults to my field and I’m home free right?


Except it doesn’t work :frowning: :face_with_raised_eyebrow:
image

I have no idea where this sequence went wrong.
The only conclusion I can come to is that I’m not accessing the ErpSearchResults dataview correctly; but, I can’t tell where I’ve messed up.
If I test it by using the searchResult dataview directly…


It transfers data; but not the data I need. :expressionless_face:
image
image
But I still can’t get the data I need from ErpSearchResults dataview. What am I doing wrong?

1 Like

So I’ve never used the search-show widget - frankly I didn’t know what it meant so I ignored it.

But I use the erp-baq widget all the time. You can throw a where clause at it and it runs very fast. Any reason to not use that?

Main settings

“Execute options”

And the where clause (for my scenario)

Part_PartNum = '{UD09.UD09_ShortChar01}' and PartPlant_Plant = '{UD09.UD09_Key1}'

The users need to be able to select the shipto so I can fill in a few fields. If I just use a BAQ they don’t have the ability to do a select? Or am I wrong?

OK, so it sounds like you want to populate a combo box with the results of a BAQ? It’s finicky but that’s very doable. There are posts on that here. It might even be in the App Studio user guide.

Not quite. I want to fill in several different text boxes with the results from the search-show widget. The lookup is linked to a ‘like’ view that constrains what is returned. For a BAQ lookup that isn’t good. I need a field not contained that way and I can’t get back to it. It’s frustrating. I can see it in the search-show but can’t access it thereafter.

I’m not saying you are wrong, and I have not used or tried everything.

But my architectural approach is probably wildly different than yours.

For any filters I make a data view and store values there (what the user selects). Then Combo boxes will filter on the selections.

Maybe I am missing the mark though. Can you send a screenshot of what you are trying to do or what you want it to look like?

1 Like


The idea is that you can click on the lookup and get the data for the other fields. I can’t link them to a table because sometimes they need to be typed in and NOT pulled from the ShipTo.

That’s the customer ID, right?

And that’s your BAQ. If so, do I deduce that there is only one ship-to for every “Mold Maker customer”? (You expect to only get one row from the BAQ?)

Sure, makes sense.

You’re saying that the EpBinding of Mold Maker ShipTo is not to searchResult.something, but to some other data view (userInputData.something2 or whatever).

But you want searchResult.something to populate userInputData.something2 when they search, and then the user can edit it from there.

Is that right?

Exactly so.

OK I think I am catching on.

Well, yeah, all of your screenshots seem to suggest the data is coming through OK, except that row-update.

So, I’ve been using the Expression box, not the Value box. I saw others do it, so I did. :man_shrugging: It seems like there’s no good way to clear out the… um… value of Value (it wants to be an empty string at least), so you may have to delete and do it again.

Also, one goofball thing I have run into the last few days is that in an event, to force my connectors (the arrows) to be the “Success” type instead of blank. Seems to help. (But, you know, true and false arrows are fine.)

No joy. Same issue. It can’t find the data.
When I try to access ErpSearchResults I get an undefined.

Yeah that is strange. From your screenshots it seems like the data just disappears at exactly the moment you need it.

What is the dataview-filter doing? Shouldn’t need that. Also in your row-update the value field should be “{searchResult.ColumnName}” instead of in expression

Without the dataview filter the ErpSearchResults dataview has the complete list from my original BAQ. Thousands of records. The filter locks it down to one row. “{searchResult.Customer_CustID}” Doesn’t work. Still says undefined.

Search show widget asks you to select a row (or multiple) from search results. This is the row returned in searchResult dataview. What does the dataview filter look like that the search show isn’t doing?

The Search-Show Widget doesn’t actually return the row from the BAQ. It returns the row from the associated “like”. Not what anyone would expect. I would argue that the “like” actually works against what most would use this for.

What is the BAQ doing that Customer search can’t do. Can you show the BAQ display columns

I need the CUSTID and the Formatted Address. ShipTo only gives the Customer Number. Yes, I could drop it into a second lookup, but why should I have to do that?

Try single quotes here instead of double. CustID is a string.

Below is an example I have working of doing a row update with a string value which is working: