Part Entry: default UOM class

Part Entry will default a part’s UOM Class to the system default UOM Class when creating a new part. I instead want all users to be forced to select the UOM manually for every new part that they create, since it can’t be changed after the fact.

Ideally the UOM Class field could be set to blank as the default value (or ‘CHOOSE ONE’) when creating a new part and then Part Entry will not allow them to save until they specify a valid UOM Class manually. I can’t seem to find a way in Customization that I can do this and still have the combo pulling the list of UOM classes available for the drop down.

What is the best way to approach this?

Perhaps a post processing BPM on this? In earlier versions of the DMT using Part combined I found that it would use the default UOM class regardless of what was added to the data and I had to run a second pass to update it.

@aaronssh In GetNewPart PostProcessing, populate an invalid UOM Class like ZZZ which will force user to select a valid one.

1 Like

@Arul, thank you for pointing me to GetNewPart. I was trying to use PartUpdate.

So I have created the BPM and included two informational windows so that I can confirm that it is processing. When I create a new part, the first message comes up to let me know the BPM started, then the second message comes up to let me know that it set the value. However, I am not seeing any change to the Class ID field in the interface. What am I missing?

Shouldn’t it be a Pre-process, if you want to set the UOM?

I was always under the impression that the info in a Post-Proc “has already been used”. Like its telling you what has already happened. While a Pre-Proc is used to change what is about to happen.

edit

I was wrong on the above (hence the strike through)

Also, in a Post-Proc, I can successfully set the IUM, but not the UOMClass.

So I have tried it both Pre-process and Post-process and am getting the same result. The UOM Class ID field is an UltraCombo field set to RetrieveOnActivate. Maybe it’s not possible to override that?

I found something very interesting…

  • Our default UOM Class is COUNT

  • With a Post-Proc that sets UOMClassID to ‘CNT-OTH’, and IUM to FT, it fires. But the screen still shows COUNT for the Class, while the IUM is updated.
    image

  • But as soon As i enter a P/N and hit tab, the UOMClass changes to the one I set it to. And Updates the SUM and PUM.
    image

edit

It’s like the underlying dataset is correct, yet the UI is showing the wrong dropdown entry. Maybe a customization to refresh that dropdown, when a new (but blank) record is loaded.

edit #2

I notice that the dropdown has an extra entry in it. See how there is two COUNT entries?

image

If I select the 1st COUNT it sets the UOMs to EA (the default for class COUNT)
If I select the 2nd COUNT it sets the UOMs to FT (the default for class CNT-OTH, the class the Post-Proc MD sets it to)

@aaronssh I tried to do the same with defaulting warehouse based on Purchased or Manufactured and there is a lot going on that is not trappable. I resorted to making a warehouse called DEFAULT and then would not allow the part to be updated if DEFAULT still existed.

@gpayne I wish we could do that here. We want the end user to (mostly) be selecting our UOM mixed class of type Other and there is no way to set an Other class as a system default. One of the system UOM Classes (Count, Length, Weight, etc) has to be default, in this case Count. But we can’t block people from creating any parts with Count since it is very much needed sometimes.

I think hes saying make a UOM Class that can be a system class, and set it as the default. Then BPM on part update, that raises an exception if that default UOM Class is still selected

1 Like

My UOM Class on a part add is an Other class Units. I don’t have any set as system default. I don’t see any bpms that set Units, but I will do some searching.

1 Like

@ckrusen right, but if I do that and use Count for example, I can’t raise an exception on Count because sometimes we really do need Count. Same for Length or any other system class. You can’t add a second class which is also of type Count or Length, so we’re limited in what we can do.

Your examples look like they may be on Epicor v8 or v9. I don’t know if these UOM Class restrictions that I am mentioning are maybe new to v10?

The images above are from 10.2.300.

It would only work if you have an unused “typical” class. Like we don’t have a Class of type Time, so we could use that (but in the future, we’d have to use a type OTHER if we wanted to add time based UOMs).

Just did a quick test. When the part is added it comes up Units ( which is an Other), but after adding description and saving I am able to use the code below on Part.Update to change to Volume Units which also an Other. I am on 10.2.400.15

I do get the message saying Units can’t be the system default, but nothing complains I don’t have a default UOM.

Greg

if (ttPartRow.TypeCode == "P")
        {
            ttPartRow.LotAppendDate = "MMYYYY";
            ttPartRow.UOMClassID = "Volume Units";
            if (String.IsNullOrEmpty(ttPartRow.ProdCode))
            {
                ttPartRow.ProdCode = "OM0";
            }
            if (String.IsNullOrEmpty(ttPartRow.ClassID))
            {
                ttPartRow.ClassID = "0000";
            }
        }

It can be done in a customization.

Add a AfterToolClick event like

private void PartForm_AfterToolClick(object sender, Ice.Lib.Framework.AfterToolClickEventArgs args)
	{
	if(args.Tool.Key == "NewMenuTool" || args.Tool.Key == "EpiAddNewNewPart"){
		EpiDataView edvPart = (EpiDataView)(oTrans.EpiDataViews["Part"]);
			
		string pn = (string)edvPart.dataView[edvPart.Row]["PartNum"];
		if(pn == ""){
			edvPart.dataView[edvPart.Row]["UOMClassID"] = "CNT-OTH";
			}
		}
	}

And that shouldn’t interfere with anything like parts created in the Configurator.

edit

updated code to test for “EpiAddNewNewPart” too.

Edit #2

I’m not real up on the correct use of epidataviews, so that code might need some work.

1 Like

Calvin I have inserted the code and, while no errors are generated (great!) it also is not setting the value. Custom code stuff is over my head a bit, so I wouldn’t know how to troubleshoot that code. If you have any suggestions, that would be greatly appreciated, but I do understand if I’m asking for too much. My code is identical to what you provided except for the UOMClassID has been updated from CNT-OTH to one that exists in our system.

Did you use the Form Event Wizard? If not, you’re missing some code that is auto generated.

Do the following:

  1. Remove the whole function for PartForm_AfterToolClick
  2. Use the form event wizard to create a the AfterToolClick function.
  3. Click the Arrow to add it to the list on the right
  4. Put the contents of the code I provide into that auto generated function
  5. Click Update Selected Code.

Now go to the Script Editor. See how it added the
this.PartForm.AfterToolClick += new... to the InitializeCustomCode and DestroyCustomCode section?

This was probably missing from you first attempt.

1 Like

It works with BPMs. Update the first BPM you posted so it clears UOMClassID instead of ClassID.
Then add a post process on ChangePartNum.
Test if it’s a new part. If it is, clear all the UOM fields.


@ckrusen , that is what I was missing. Your code works great! Thank you very much!!