Filtering unused Reason Codes

I’ve added a custom field like “Inactive_c” to many tables like ProdGroup, PartClass, etc… Then anywhere a user can select an entry from that table, I add a filter for Inactive_C = false.

This is close.
Here’s the syntax:

And the result (all of the names starting with ‘A’ are gone)

image

4 Likes

I know I am coming in late on this and a solution has been found. But if you uncheck all the boxes that the Reason Code would apply too would that not make appear in a drop down list. I know you have to have items checked to be seen so I would think the opposite.

Side note…I do wish Epicor would make more options with Inacttive or Disabled check boxes. Just helps to keep the system cleaner when changes occur.

1 Like

Coming in even later. For Reason codes use Reason.GetList. works a treat and you don’t have to apply the customisation against the menu. Bring on the Active flag.

@Kimberley Unchecking on the reason code doesn’t work for inventory adjustments (10.2.400). :frowning:

Still late to the game but an interesting use case. Our users are used to simply entering in the reason code, as opposed to using the drop down. So, if they enter “13700” + TAB, “zDoNotUse Inventory Adjust” still populates into the Reason Code field, and will post. Even though they can’t see the reason code in the drop down list. So, I’m trying to develop a BPM that will prohibit this from posting. If/when I get a solution, I’ll post it here.

This might help:

Funny this would come up. I just noticed that in RMA entry the reason code combo shows the filter as ReasonTyp = ‘A’ however it returns, what it seems to be all the reason codes… very weird… So it looks like that BPM I wrote whilst works ok for Qty adjustments breaks RMAs…

Here’s and updated one that is a bit busy and could have been better done in code.ReasonCodeFilterInactive.bpm (93.7 KB)

I’ve only tested RMA and Qty adjustment so the usual caveats apply. Put ZZ in the description of the reason code you don’t want to use.

If you wanted to make things a bit prettier you could add a ud field to the reason table that was a bool for inactive/active and run the BPM against that.

1 Like

For our use @hmwillett had the answer, the filter needed “NOT LIKE” instead of what I was trying; <>.

Hi Calvin. Always nice to hear from you in a thread! The issue/concern I have with using a BPM on Erp.ProdGrup.GetList, or any method that simply filters the list of ReasonCodes/ProductGroups etc., is that a user can still type in a reason code that’s not on the list and post/save. That’s the issue I’m having right now. They don’t even use the list, just type in a code they have been using for 10+ years that is now defunct. So, what I really think I need is something that does a secondary validation prior to Post/Save. What are your thoughts?
-S

Have the BPM verify that the code is valid before the save and reject if it’s not a valid code. May need to add a UD checkbox to mark older existing codes that are now “defunct” as well.

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: