Remove value when clicking field

I am wondering if it is possible in the Issue/Return material module, to have the quantity be blank when it is clicked.
Background: As of now, the field has a value of 0 and our users sometimes forget to delete the 0, resulting in an additional 0 when pulling/returning material

I have tried to make a customization where the “Text” value of the field is blank instead of 0, but when I save and go in it, it just changes back to 0.

Thank you!

It is most likely a Numeric Editor control, which should always have a value. That’s why “blank” ends up being zero.

You could try creating an OnFocus() event that sets the text selection start, stop and length to include the whole “0” (basically doing a “Select All” upon entering the field. It won’t be blank but the very next keystroke would replace the selected text with what they are typing. Similar to what you would see if you used the TAB key to enter the field.

1 Like

Hi Calvin, thank you for your response!
I just tried that, and it looks like I could not put an event if the control is not a custom control. Am I able to manually create an OnFocus or an OnClick event?

There is a bit of a hack - it is a sound solution, but not what Epicor intended to be done - that allows adding events to built-in controls. Let me find a link to a post describing it in detail.

Here it is:

1 Like

That did it! I appreciate your help!


I wouldn’t call it a hack. They wouldn’t have given us a helper method to get native controls if it
was :slight_smile:

how hard would it have been for Epicor to allow the wizard to add events on native controls?

Maybe it was intended as more of an “advanced” feature.

“Here it is, you break it, you buy it!” :rofl: