Null value within Quantity fields vs defaulted "0"

Is there a way to set Quantity fields to null versus defaulting to “0” within the configuration of the company/site etc…? Would this require a BPM to be null but force a quantity to be entered before saving?

depends on the field. Some fields are not nullable. For ones that are, when using a numeric editor, the editor automatically fills in a 0, (which is annoying). So it would have to be some custom coding in a UI or a BPM to take 0’s and make them null.

Thank you Brandon, I appreciate the help - the user was looking at the Quantity field in Quantity Adjustment - my logical mind was doubtful it could be done, but it never hurts to ask!

why would you need a null in that field? You can’t make an adjustment without a value in there. (it won’t take 0 either)

In the case of this field, I am thinking what is happening is the user isn’t Tabbing through the location to then highlight the zero to overwrite it - (in the email to me, she mentioned Users typing their quantity not realizing the zero was still at the end of their number and saving their transaction).

yeah, that’s a matter of people not paying attention to what they are doing. Happens here too. But there are some behaviors you just can’t program around no matter how hard you try.

If you really wanted to get fancy, you might be able to get a customization that on field click it clears the field, or maybe highlights, like a tab. I haven’t done it, but may not be too hard.

https://docs.microsoft.com/en-us/dotnet/framework/winforms/controls/how-to-select-text-in-the-windows-forms-textbox-control

2 Likes

That’s an interesting idea - I will think on that - or the cheaper route suggest Users are mindful of their entries. :smile:

2 Likes

The Epicor ERP 10 database and software are setup so that the only column type that is Null-able is a Date / Date Time type column. All other field types are expected to have a default value - enforced by SQL. Numeric field default is 0. String type is Nil (empty string). I believe Boolean types are True.

2 Likes

@rich, she doesn’t want it null going into the database, she just wants it easier to type in. When you are dealing with shop workers that type with one finger, they can’t look at the screen and type at the same time. And they are allergic to the tab key too.

1 Like

Will a numeric field in a table accept a null?

I can see having a null value in a view or BAQ result when using a Left joined sub query. For example. A query that returns the max line number for an order from OrderDtl, when the OrderHed has no associated OrderDtl records.

I’ve struggled with the same problem too. @Banderson’s idea is interesting idea!

It’s basically, OnGetFocus (select all), no?

One way I’ve seen this addressed for shop personnel is through a customization that automatically highlights the entire field when it is clicked to gain focus. This happens by default when you tab into it, but not when you click into the field. We were having shop workers wanting to report 5, but didn’t remove the 0 so they reported 50. The auto selection resolved this issue.

There is a setting in the Sysconfig – SelectTextOnEnter – that is supposed to select the Text when a control gets focus but there are several “nuances” to that including the Click in with the mouse vs tab in to the field.

Default for that setting is False but you might try changing it to True to see if that helps.

4 Likes

To play devils advocate …

I’d suggest removing the fields current contents over just selecting them all (like tabbing into it would do).

I could imagine a user seeing the 0 in that field, clicking just to the left of it, expecting it to place the cursor before the existing 0 (when actually it selects the 0), and just hitting the 5 when they want the field to be 50.

The fact that any typing replaces the selected contents, isn’t as obvious as you’d think - How many times do you see someone select the entire contents of a field, and hit backspace to clear them before typing the new value?

I found this but haven’t changed our form yet to try it so no idea if it would work in Epicor.

https://www.infragistics.com/community/forums/f/ultimate-ui-for-windows-forms/85122/ultranumericeditor---integer---highlight-all-text-or-blank-out-default-value

maybe @WildERP will show you how the customization works.

1 Like

Pretty similar to your post Randy,

this is on the CurrentQty field on Report Qty screen.
private void CurQty_num_Click(object sender, System.EventArgs args)
{
// ** Place Event Handling Code Here **
CurQty_num.SelectionStart = 0;
CurQty_num.SelectionLength = CurQty_num.Text.Length;

}
3 Likes

From the infragistic link from above…

Once you have entered the control and established a SelectionStart point, subsequently tabbing into the control will remember the last position of the caret and use that instead of selecting everything.

I’m not seeing this happen.

I’ll click into the Bid Revenue field, setting the cursor between the 3’s. Then Tab out, and then shit-Tab back in. From the quote above, I’d expect the cursor to appear between the 3’s again, and not select the entire contents. But it does select the entire contents.

infrgistics%20UI%20tab

Thanks @WildERP that works for my form!