# Remove 0 from numeric fields?

**URL:** <https://www.epiusers.help/t/remove-0-from-numeric-fields/50689>\
**Category:** Epicor ERP 10\
**Tags:** customization\
**Created:** [December 17, 2018, 4:55pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689 "2018-12-17T16:55:04Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Randy](https://www.epiusers.help/user_avatar/www.epiusers.help/randy/32/51539_2.png) [@Randy](https://www.epiusers.help/u/Randy)\
**Post date:** [December 17, 2018, 4:55pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/1 "2018-12-17T16:55:04Z")

</div>

So I have a custom RMA form I’m working on. We sometimes have our own people/installer deliver orders and them to grab the RMA while at the customers site. The “Pickup With” field is for the CSR to enter in the SONum of the order to which this RMA should be picked up with.

However, the field always shows a zero on new records, or ones that don’t need/have a SONum entered. How do I remove the zero like the standard SONum fields on forms?

![image](https://epiusers.help/uploads/default/original/2X/8/86d9d4618adb973d05c5a37eac7e6e712346030a.png)

---

<div class="post-metadata">

**Author:** ![Chris\_Conn](https://www.epiusers.help/user_avatar/www.epiusers.help/chris_conn/32/93797_2.png) [@Chris\_Conn](https://www.epiusers.help/u/Chris_Conn)\
**Post date:** [December 17, 2018, 5:02pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/2 "2018-12-17T17:02:44Z")

</div>

I wonder if you can just change the default value for field from 0 to null in table maintenance

---

<div class="post-metadata">

**Author:** ![Randy](https://www.epiusers.help/user_avatar/www.epiusers.help/randy/32/51539_2.png) [@Randy](https://www.epiusers.help/u/Randy)\
**Post date:** [December 17, 2018, 5:15pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/3 "2018-12-17T17:15:02Z")

</div>

Sadly, I tried that… it also keeps coming back with a zero.  
 ![image](https://epiusers.help/uploads/default/original/2X/5/51a5db89d3717a5a34a768361140ccb35b2518af.png)

---

<div class="post-metadata">

**Author:** ![ckrusen](https://www.epiusers.help/user_avatar/www.epiusers.help/ckrusen/32/50584_2.png) [@ckrusen](https://www.epiusers.help/u/ckrusen)\
**Post date:** [December 17, 2018, 5:26pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/4 "2018-12-17T17:26:14Z")

</div>

Make another UD field named `PkUpSONumTxt_c`, of type text.

And us a DD, BPM , or UI Code to convert the value of PkUpSONum\_c to a text string for PkUpSONumTxt\_c

---

<div class="post-metadata">

**Author:** ![Randy](https://www.epiusers.help/user_avatar/www.epiusers.help/randy/32/51539_2.png) [@Randy](https://www.epiusers.help/u/Randy)\
**Post date:** [December 17, 2018, 5:27pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/5 "2018-12-17T17:27:43Z")

</div>

Hmm, Google a bit and found this infragistics tip: [Show "n.a." based on Cell-Value | Infragistics Forums](https://www.infragistics.com/community/forums/f/ultimate-ui-for-windows-forms/40477/show-n-a-based-on-cell-value/228416#228416) I’ll try to see if I can get this to work on form load event.

The standard Epicor fields for Sales Order use a Text fields, so like @ckrusen suggested.

 ![image](https://www.epiusers.help/uploads/default/original/2X/7/704ea29c9c26306c91c55ff14819a9d431749356.png)

---

<div class="post-metadata">

**Author:** ![ckrusen](https://www.epiusers.help/user_avatar/www.epiusers.help/ckrusen/32/50584_2.png) [@ckrusen](https://www.epiusers.help/u/ckrusen)\
**Post date:** [December 17, 2018, 5:27pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/6 "2018-12-17T17:27:53Z")

</div>

What if you change the Format from `>>>>>>>>>>>>>>9` to `>>>>>>>>>>>>>>` ??

---

<div class="post-metadata">

**Author:** ![Banderson](https://www.epiusers.help/user_avatar/www.epiusers.help/banderson/32/50875_2.png) [@Banderson](https://www.epiusers.help/u/Banderson)\
**Post date:** [December 17, 2018, 5:28pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/7 "2018-12-17T17:28:02Z")

</div>

Couldn’t the SO number simply be a string? It’s not like you’ll be doing any math with it right?

---

<div class="post-metadata">

**Author:** ![Randy](https://www.epiusers.help/user_avatar/www.epiusers.help/randy/32/51539_2.png) [@Randy](https://www.epiusers.help/u/Randy)\
**Post date:** [December 17, 2018, 9:59pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/8 "2018-12-17T21:59:07Z")

</div>

I think @Banderson has the correct plan. I’m using the entered SO# to pull data from the Order table (actually ShipTo via the order table). I changed the code to convert to int32 and it’ll pull the data just fine.

The following error occurs when either text is entered or the occasions when the SO# will need to be cleared back to empty.  
 ![image](https://epiusers.help/uploads/default/original/2X/a/a127c8d7c880449c293ac1e8c5d0607d7b4c2896.png)

How do I restrict text entry? I tried setting the FieldFormat on UD Column Maintenance but it still allows text to be entered. Must be someway in code to do it.

We could probably live with the 0 or this error even if necessary but this is a good learning experience for me too.

---

<div class="post-metadata">

**Author:** ![Banderson](https://www.epiusers.help/user_avatar/www.epiusers.help/banderson/32/50875_2.png) [@Banderson](https://www.epiusers.help/u/Banderson)\
**Post date:** [December 17, 2018, 10:01pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/9 "2018-12-17T22:01:54Z")

</div>

Did you delete and re-add your UD field? (as an nvarchar?) and are you looking for a valid SO number from epicor? If so use an adapter and do a GetByID, then you can know that it’s not only numeric, it’s also a valid SO#

---

<div class="post-metadata">

**Author:** ![Randy](https://www.epiusers.help/user_avatar/www.epiusers.help/randy/32/51539_2.png) [@Randy](https://www.epiusers.help/u/Randy)\
**Post date:** [December 18, 2018, 4:58pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/10 "2018-12-18T16:58:13Z")

</div>

I got the GetByID doing the SO# verify the SO#s.

---

<div class="post-metadata">

**Author:** ![Banderson](https://www.epiusers.help/user_avatar/www.epiusers.help/banderson/32/50875_2.png) [@Banderson](https://www.epiusers.help/u/Banderson)\
**Post date:** [December 18, 2018, 4:59pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/11 "2018-12-18T16:59:18Z")

</div>

Are you still getting your format error?

---

<div class="post-metadata">

**Author:** ![Randy](https://www.epiusers.help/user_avatar/www.epiusers.help/randy/32/51539_2.png) [@Randy](https://www.epiusers.help/u/Randy)\
**Post date:** [December 18, 2018, 8:26pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/12 "2018-12-18T20:26:36Z")

</div>

Yeah, it’ll be up to the users if they want to go with a number only field and live with a zero or do a text field and get those errors.

---

<div class="post-metadata">

**Author:** ![Banderson](https://www.epiusers.help/user_avatar/www.epiusers.help/banderson/32/50875_2.png) [@Banderson](https://www.epiusers.help/u/Banderson)\
**Post date:** [December 18, 2018, 8:27pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/13 "2018-12-18T20:27:52Z")

</div>

You should be able to do a text field and not get those errors.

Did you remove and re-add your UDField so it’s a text field instead of a numeric field?

![image](https://epiusers.help/uploads/default/original/2X/f/f7843a44fec160a492539c5fc87ef31d3c1672ec.png)

---

<div class="post-metadata">

**Author:** ![Hogardy](https://www.epiusers.help/user_avatar/www.epiusers.help/hogardy/32/18785_2.png) [@Hogardy](https://www.epiusers.help/u/Hogardy)\
**Post date:** [December 18, 2018, 8:40pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/14 "2018-12-18T20:40:33Z")

</div>

That is a good point from Brandon…  
Delete the original ud field regenerate all and recycle…(or put back it’s original type…and dont use it…)

Then add a new UD field nvarchar.

I had similiar issue, where getting same error…not just me, the other users trying to print…as I did not redo a regenerate… not all settings were in sync…

So my rule of thumb : if a need to change type, do not change current field…create a new one… got me less problems…😉

Pierre

Pierre

---

<div class="post-metadata">

**Author:** ![Randy](https://www.epiusers.help/user_avatar/www.epiusers.help/randy/32/51539_2.png) [@Randy](https://www.epiusers.help/u/Randy)\
**Post date:** [December 19, 2018, 4:57pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/15 "2018-12-19T16:57:32Z")

</div>

I did add new UD fields, I’ve never gotten the type to change on existing UDs.

The error isn’t the issue, the problem was as a nvchar field, it allows text to be entered. This is a SONumber field, which doesn’t allow text. If a user enters text the script tries to verify the SO# against the database. The result should be an error and that’s what we get:  
 ![image](https://epiusers.help/uploads/default/original/2X/a/a127c8d7c880449c293ac1e8c5d0607d7b4c2896.png)

---

<div class="post-metadata">

**Author:** ![Banderson](https://www.epiusers.help/user_avatar/www.epiusers.help/banderson/32/50875_2.png) [@Banderson](https://www.epiusers.help/u/Banderson)\
**Post date:** [December 19, 2018, 5:11pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/16 "2018-12-19T17:11:50Z")

</div>

but if they enter a number, then it works fine? So Basically, with your GetByID validation, it effectively does what you want it to right? Block them from putting in an invalid SO number. (Or does this make it never work?)

Could you throw in a try statement to try a convert the value to an int, then if it doesn’t throw a more intelligent error?

---

<div class="post-metadata">

**Author:** ![Randy](https://www.epiusers.help/user_avatar/www.epiusers.help/randy/32/51539_2.png) [@Randy](https://www.epiusers.help/u/Randy)\
**Post date:** [December 19, 2018, 5:33pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/17 "2018-12-19T17:33:20Z")

</div>

Yes it works perfect, if they enter a good SO# they don’t get any error. If I could stop text entry at all that’d be cool but not a biggie.

---

<div class="post-metadata">

**Author:** ![Banderson](https://www.epiusers.help/user_avatar/www.epiusers.help/banderson/32/50875_2.png) [@Banderson](https://www.epiusers.help/u/Banderson)\
**Post date:** [December 19, 2018, 5:36pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/18 "2018-12-19T17:36:56Z")

</div>

I think you should be able to change in the input mask on the text box to only allow for numerals. I started googling, but haven’t found specifically what you need yet, but I think it’s entirely possible.

---

<div class="post-metadata">

**Author:** ![Banderson](https://www.epiusers.help/user_avatar/www.epiusers.help/banderson/32/50875_2.png) [@Banderson](https://www.epiusers.help/u/Banderson)\
**Post date:** [December 19, 2018, 5:39pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/19 "2018-12-19T17:39:31Z")

</div>

You could do validation on each keystroke and check if it’s a numeric field. I’m pretty sure there is a keydown event in the wizards. (this might be overkill… anyone can feel free to jump in and give a better suggestion if you have one)

[https://www.infragistics.com/community/forums/f/ultimate-ui-for-wpf/43358/apply-decimal-mask-to-a-textbox](https://www.infragistics.com/community/forums/f/ultimate-ui-for-wpf/43358/apply-decimal-mask-to-a-textbox)

---

<div class="post-metadata">

**Author:** ![Randy](https://www.epiusers.help/user_avatar/www.epiusers.help/randy/32/51539_2.png) [@Randy](https://www.epiusers.help/u/Randy)\
**Post date:** [December 19, 2018, 5:42pm UTC](https://www.epiusers.help/t/remove-0-from-numeric-fields/50689/20 "2018-12-19T17:42:35Z")

</div>

I’ve done some google searches too. This is the initial design of the new form and more iterations will come as the users get into testing it. I was going down this rabbit hole as I was waiting on feedback from them.

Thanks for the help @Banderson and everyone else.
