Application Studio passing Parameters to BAQ

New to Group and Application Studio…

Basic Issue: BAQ with Single Parameter. (returns single Part record given Part Number)
Application Panel with Single Text Box (For Part Number) for entry and display Fields linked to View

Currently “On-Blur” event causing popup asking for BAQ parameter. want to use Textbox value as BAQ parameter to return Part record.

Need correct syntax and how to wire it all up…should be simple…

Some Additional Context:

BAQ has @PartSearch as parameter (Tested returns single row )
On-Blur Event triggers BAQ
BAQ Pops up Parameters entry;
image

Need the event to pass Textbox value to BAQ ?

Fun Youre Wrong GIF by roc friese poort

1 Like

Edit: I guess I should add some more context since you’re new, lol.

Create a BAQ Dataview to hold the results of the BAQ

Create the onBlur event from your textbox and load up the BAQ in GET mode.
Assign it to a dataview as well, so the data has somewhere to go. I suppose, technically, you could probably use ActionResult, but setting it to a defined dataview makes it easier to follow along and understand.

Set the parameter to be {DataView.Column} which is dependent on what you set the epBinding to for your textbox

I’m using TransView.PartNum. TransView is a runtime view that gets created on the fly. If you have a defined dataview, that’s fine too.

Not sure what you’re doing after the BAQ runs, but in this instance, I’m setting the result of the BAQ to the field TransView.PartDesc which is bound to the textarea below the textbox.

Results!
BAQParam

I would also like to say that you’re lucky you’re on v2023.1. This was not trivial in the previous versions, lol.

Fresh Meat GIFs | Tenor

Thanks for the reply,
I have the Dataview:
image

and have two Panels;
image

Event:

If I have an EpBinding set for the Textbox, it is un-editable at runtime.

image

ItemView should be the return data, not your parameter data.
You cannot edit it because that view is not initialized by anything.

Out of curiosity, what are you trying to do?

It looks like you’re trying to create a search by part number. Is there something special about the data being returned in the BAQ?
If not, every textbox widget has a property called “Enable Search” that will add a magnifying glass to the textbox that a user can click on to initiate a standard search. I have a post out there somewhere on how to wire it up if you need or want.

You can also wire it up for your own events :slight_smile:

It is Basically a Search, however user already knows the Part Number, Just needs the record.
So currently the issue is just getting the value from the Text Box, into the BAQ parameter.

Right now when running I can enter Part:
image

BAQ Parameter Window pops up:
image

Enter Part Again: (Press OK)
image

BAQ Runs and Items Display:
image

You are correct in that the ItemView is uninitialized until BAQ runs.
I end up with the same basic issue, where is the Textbox value stored and how to pass (reference) that in the BAQ parameter field and run without the popup…

The fact that the erp-baq has a BAQ Parameter section suggests that, I just do not know the syntax to reference the initial textbox value.

Why not bind the search field to TransView.PartNum? Does it ever need to be saved to the database? If not, TransView will serve for your needs.

how to pass (reference) that in the BAQ parameter field and run without the popup…

To this point, you wired it correctly, but I would change the binding to something else. If that field has a value, it will pass silently, otherwise it should still slide out.

I must be missing TransView initialization?
If I set EpBinding for the Textbox :

image

with the Event BAQ Parameters set;

image

and try to Preview, I can not enter any values in the textbox…
image

it’s just grey…

Should I be doing something with the Panel EpBinding?

The parameter value should have curly braces: {TransView.PartNum}.

What screen is this in? Is this native (I assumed it was)? If not, you will need to create the initialize event.
Create an event that fires after Form_onLoad and use a row-update to set TransView.PartNum to "".

Hannah, Thanks so much for your support, I did try with and without {} , still no luck.
I will clear the current App and start Fresh as it’s getting a little messy.
Will advise if I get it working.

Check the payload of the ExecuteBAQ call in Dev Tools on the network tab to see if your value is actually being passed.

That being said–I thought your field was currently read only? Or did you get it initialized?

I can’t see BAQ Parametrs in erp-baq widget.
Is it because of version 2022.2.14? If this is a case - is it possible to pass parameter somehow to avoid slider?

You can, but it’s painful.
You have to use REST and call DynamicQuerySvc.
I have a reply on another post with how to do it.

@phoenix What are you doing with the return of the BAQ?

Might be easier to just call a function and do your work there.
Pass the data back.

Couldn’t find your post… was searching for DynamicQuerySvc keyword
Starting from which version a “BAQ Parameter” option is available?

Already have few BAQ’s and not going to convert to function (I know I can call BAQ from within function - but hoping that I can do it from AS)