Filtering Combo Boxes in Application Studio

Good Evening,

I have been creating a Combo Box that spits out a single field from a BAQ that I am pulling into a Data View. I want this Combo Box to list all the email addresses for the customer that is related to the Order, so I was thinking once the BAQ is loaded (after the AfterGetByID event) it should just show the contacts related to this order, but that is not how it works I noticed. I forgot to take into consideration that there is nothing tying the BAQ and the Order together, so I tried creating filters in the BAQ load event, in the data view that is populated from my BAQ, in the BAQ itself, and in the Combo Box reusable combo settings, but nothing seems to work. I feel like I am just getting the syntax wrong because I saw a few posts, but I am not sure when to use {} or or what the? does when putting that in a filter. Here is my latest attempt so far.

image

Some filters I have tried:

Static filter under DataView: CustCnt_CustNum=‘?{OrderHed.CustNum}’

Reusable Combo Settings: Filters Append:
CustomerEmail.CustCnt_CustNum=‘?{OrderHed.CustNum}’

Reusable Combo Settings 2:
Filters Params: OHedEmail=[OrderHed.CustNum]
Filters Append: CustCnt_CustNum=‘?{OHedEmail}’

I have tried many more different filters but I cant say I am smart enough to remember them all. If anyone knows the rules behind the syntax here or how I can learn more about them that would be awesome!

Could you use the browser dev tools to show the values that are returned by your BAQ? just to see if you see what you expect?

I could be wrong, but your EpBinding might be shooting you in the foot - it should not be bound to the result set, but to the value you are trying to set.

Are you trying to use the combo box to display the list of emails? not actually to select one?

CustNum is an integer, so could (or should??) remove the single quotes around the variable calls … your BAQ call should work (maybe without the quotes?) When are you calling the CustomerEmail_Get event?

I can see the BAQ results in the baq designer, and it looks fine, I am getting the entire list of emails for every contact in the company and filtering out a few bad entries, so that is working fine.

and you might be right about the epi binding, so I originally had it as a shortChar field but I couldnt find out how to populate the field with anything. I am trying to use the combo box to display a list of emails for each customer, so it’s going to be multiple options (one for each contact in a company) then let users select one that they want to save for the order.

and okay I will try without the single quotes, I am calling the event after the event “AfterGetByID” which I though made sense but I was thinking the BAQ would pull everything regardless so maybe that is wrong too?

Quick update, I think I have gone back to trying to not use a UD field, I can’t seem to get the data to pass through to a field I defined no matter what, but I can output what is on the dataview so thats good, just need to figure out how the reusable combo fields work because I don’t understand what the tools tips are trying to tell me, if anyone knows enlighten me, please and thank you!

My approach on this would be to look at the dropdowns on Order Entry and see how they’re constructed (open them up in App Studio)… then see if you can recreate & tweak for your purposes.

For example… they already have drop downs to populate CustCnt(s) for the Sold-To, Ship-To, and Bill-To accounts:
image

I would start with that… don’t use “default” as the subtype, so you can make changes to the settings.

For example, you’d want to have the Retrieve Columns to include EmailAddress… Would need to adjust the Filters so you can feed it a CustNum… change the Text Field and Value Field to your use…

But, it would give you a road map, perhaps.

1 Like

I almost exclusively tie combos to UD fields - so I am curious why this isn’t working for you. Is the UD Field part of OrderDtl?

No I think? When going down that route I was trying to figure out how to send data from in this case the CustCnt.EMailAdress field to a UD field in the OrderHed table, which I am assuming is the “ShortChar” fields, but now I am second guessing if I know what a UD field is after I looked into it further. After that I would just be able to call it in the OrderHed table I assume if I can do that successfully.

1 Like

That is really clever, I can’t believe I missed that there were other fields here referencing the CustCnt table. I see why you name pops up everywhere on this forum haha. I copied most of the information and it worked exactly as intended! I used a random ShortChar field to hold the data.

I am kind of curious though, I feel like I am missing a fundamental understanding of where the Table is coming from and how it relates to the service, but I am not too sure. Can I call any table using the related service as long as I know the table name, and how would I figure that out if I didn’t have an example to copy? Just kinda curious how it all works.

Here is what I got that worked with the correct filters though!:

2 Likes

Comparing to one of the dropdowns on Order Detail page:

You have a mis-type here (missing a “d”):
image

If you want to “sort” by Name, you might need to include that in the Retrieve columns as well. Not positive on that. Should be able to list them both, separated with a comma.

But, if it works, it works!

image

Well, I don’t have an answer to that unfortunately. There is a CustCnt table, but there is no CustCntList “table”. Kinda like there is a SalesRep table, not a SalesRepList table. So… I also have no clue how you would know that without an example like this to go off of.

Good catch, just fixed that, and I guess epicor works in mysterious ways sometimes. Ill quote another great and say that sometimes, it just works!

Thanks again both of y’all saved me a lot of headaches and taught me something, appreciate it

2 Likes