Filtering unused Reason Codes

What screen is this on?

I filter out a Reason Code (via the a BPM on ReasonCode.GetList). Then on the Qty Adj form, the Reason isn’t in the dropdown. Manually typing either the Code or the Description, both yield with:

image

1 Like

@SheMunkee - I looked at the control on the Qty Adj form to see what type it was, thinking maybe there was a property to limit it to just the List members. But its not your basic EpiCombo or EpiUltraCombo.

You could hide the original control on the form and replace it with a a custom one that doesn’t allow manual entry. But this might not be straightforward, as this is one of those dropdown controls that shows one value (the description), but uses another (code) for biniding.

Specifically, I was working on the Misc Issue form, but yes I’d also need to make this work at Qty Adjust too.

Hi Randy. That’s exactly what I’m trying to do. Since erp.Reason isn’t part of the business object (that I saw?) would this have to be written in C#?

It does work in Qty Adj form - And by work mean that manually typing a Reason’s Code or Description into the combo, fails to process. Showing the above mentioned “Invalid Reason Code” message.

When they type the reason, are they really just typing the first few characters and it jumps to that item in the list?

In the UI, you can set the style of the control to a DropDownList to prevent entry.

epiUltraComboC1.DropDownStyle = Infragistics.Win.UltraWinGrid.UltraComboStyle.DropDownList

Where epiUltraComboC1 is your control.

Does that work when the control type is:

Erp.UI.Controls.Combos.ReasonCombo

and other “extended” Combos?
(like Erp.UI.Controls.Combos.UOMCombo or the dreaded GL Acct Combo)

I don’t see why not? It’s just Epicor’s version of the base Infragistic control.
That being said–I haven’t tested it on a retriever combo sooo… ¯\_(ツ)_/¯

The ReasonType for Issue might be different to QtyAdj (Adjust is ReasonType=M)

The Reason.Getlist uses a where clause to filter so in order to manipulate the list you need to modify the where clause. This overrides the filter on the combo box.

If you take a look at my BPM I put all the reason types in it and modified the where clause to Description NOT LIKE ‘ZZ%’ AND ReasonType=‘x’ (where x is the reasontype). When I was testing I put a messagebox in the BPM to show the where clause to identify the ReasonType. A bit of a clunky debugging method. But it helped me work out where my problems were.

The reason types are in the reason data dictionary, unfortunately in 10.2.400 in the field description there appears to be a duplicate for C.

It’s been a while… so here’s what I’ve done thus far… I know it’s a long post but it includes screenshots and videos.

  1. Create custom checkbox field: Reason.Inactive_c
  2. Create customization to add Inactive checkbox to Reason Code Maintenance
  3. Create BPM on Erp.Reason.GetList to filter where Reason.Inactive_c = 0. This only removes inactive reason codes from the list. See below Screen Shots

So what’s the point, right? Well, we are trying to prevent folks posting with a key’d in reason code that have been marked as inactive. See video of this behavior with items 1-3 implemented linked HERE.

I want to create a BPM to validate that the reason code that is keyed in is valid. In screenshots from step 3 above, reason code 13700 is marked as inactive and does not appear on the drop down. BUT! As seen in the video in this step, you can see the user is still able to post a transaction for a reason code that does not appear on the list.

  1. Through a trace, I determined that the correct method is Erp.InventoryQtyAdj.SetInventoryQtyAdj but I’m not sure what the correct BPM would be. I do not want to prevent the users from being able to type into the field for numerous reasons, but mainly that we have 50+ active reason codes (don’t ask, I just work here LOL), so it’s faster to let people key in the one they need. So, a BPM that would validate the reason code and display an error is most desirable.

Here’s what I’ve got so far:

  1. Create a variable to hold the Reason code
  2. Use a “Number of rows in query …” condition.
  3. The query will conists of a single table (reason code for you), with table criteria to limit it to records matching your reason code and your Inactive_c field

image

Note that my example has the bit field as “Allowed”, so the table criteria is “true”, your’s should be false.

Hello. I am attempting to apply this on my SearchFilter for User Codes (UDCodes). For example, my ORD_SOURCE User Code Type has three Codes: 000, 001, and 002. If I wanted to suppress 000 from the EpiCombo drop-down, my best attempt at an EpiFilter was the following:
CodeTypeID='ORD_SOURCE' AND CodeID NOT '000'

Unfortunately, that just generates a server error when launching the Order Entry screen.

If I just use CodeTypeID='ORD_SOURCE' it works just fine, but of course still shows User Code 000.

Any thoughts on how I might modify my filter to handle this? Filtering by Inactive status would also be great.

Thanks,
Tony Gardner

I thing it’s SQL, so maybe try <> and see if it works. (Just spit balling)

CodeTypeID='ORD_SOURCE' AND CodeID <> '000'

Thanks for the spit ball, Brandon. Unfortunately, that didn’t help. One additional clue might be that the EpiCombo EpiBOName property is set to “Ice:BO:UserCodes”. Of course, the TableName property is UDCodes, so the field names should be valid.

Does it work if you don’t try to do them both? Can you get the ‘000’ to be excluded? Just trying to determine if it’s the NOT part that’s messing up, or if it’s trying to do more than one filter.

No dice. :game_die:

I believe I’ve just tried 20 or so variations of this including some other fields in UDCodes (such as IsInactive). I also created a quick BAQ to confirm that it was okay, but only the original command works.

It’s almost bedtime here on the East Coast, so I’ll revisit it on Monday.

“The problem with trial and error is that there is no third option for success.”

Have you tried SQL’s IN function?

CodeTypeID='ORD_SOURCE' AND CodeID IN('001','002')

Can you make a BAQ then use a BAQ Combo?

Thanks for jumping in, Randy. Actually, I did make a BAQ for this purpose, but couldn’t figure out how to configure it properly.

Do you mean you couldn’t configure the BAQ or get the BAQ Combo to work? Edit: Just did a quick demo as it’s been awhile since I used a BAQCombo. :slight_smile:

Settings for BAQ Combo on form:
image

BAQ: