Leading Space

Before i raise a ticket with support, should the Job Number field allow a leading space when entering a new job number?

It’s come up before and it’s “working as designed” to allow leading spaces in PartNum and many other fields. Which is quite annoying but it’s up to us to create BPMs to stop it.

Let me find the BPM code I have stored…

Not what i wanted to hear but the code would be great, many thanks Randy.

It was actually a session from Insights and I haven’t yet put this into PROD. I had this setup in PILOT but it got overwritten and I forgot to export it. (womp womp)

I have been down that road many times

Me too. You’d think I’d learn one of these days. :rofl:

This is what I use for Part numbers. Not necessarily the cleanest code, but it works. If vErrorMsg is not blank then a Raise Exception message is presented to the user with the vErrorMsg details telling them what is invalid - this way they don’t have to guess what is wrong.

string  vNewPartNum     = string.Empty;
int     vHasLeadSpace   = 0;
int     vHasTrailSpace  = 0;
string  vASCIIValue     = string.Empty;
int     vIndex          = 0;
int     vHasControlChar = 0;
int     vHasExtChar     = 0;
int     vHasEnDash      = 0;
int     vHasEmDash      = 0;

vErrorMsg   = "";   //initialize

foreach (var Part_iterator in
            (from PartRow in ds.Part
                where (PartRow.RowMod == "A")
            select new {PartRow.PartNum}
            )
        )
        {   
            vNewPartNum = Part_iterator.PartNum;
            
            // CHECK FOR LEADING SPACE(S)
            if (vNewPartNum.TrimStart() != vNewPartNum)
                {vHasLeadSpace = 1;}

            // CHECK FOR TRAILING SPACE(S)
            if (vNewPartNum.TrimEnd() != vNewPartNum)
                {vHasTrailSpace = 1;}

            foreach (char c in vNewPartNum)
              vASCIIValue = vASCIIValue + ((int)c + " "); 
            
            // ITERATE THROUGH EACH ASCII VALUE
            foreach (char c in vNewPartNum)
                {
                // CHECK FOR CONTROL CHARACTERS
              if ((int)c < 32)
                    {vHasControlChar = 1;}
                //CHECK FOR EXTENDED CHARACTERS
                if ((int)c > 126)
                    {vHasExtChar = 1;}
                //CHECK FOR En Dash CHARACTERS
                if ((int)c == 150 || (int)c == 8211)
                    {vHasEnDash = 1;}
                //CHECK FOR Em Dash CHARACTERS
                if ((int)c == 151 || (int)c == 8212)
                    {vHasEmDash = 1;}
                }
        }

//IF ANY ERRORS FOUND, CREATE ERROR MESSAGE FOR USER
if ((vHasLeadSpace + vHasTrailSpace + vHasControlChar + vHasExtChar) > 0)
    {
    vErrorMsg = "Per company business policy:\r\n";
    if (vHasLeadSpace > 0)
        {vErrorMsg = vErrorMsg + "- Part Number cannot contain leading spaces.\r\n";}
    if (vHasTrailSpace > 0)
        {vErrorMsg = vErrorMsg + "- Part Number cannot contain trailing spaces.\r\n";}
    if (vHasControlChar > 0)
        {vErrorMsg = vErrorMsg + "- Part Number cannot contain ASCII control characters.\r\n";}
    if (vHasExtChar > 0)
        {vErrorMsg = vErrorMsg + "- Part Number cannot contain ASCII extended characters.\r\n";}
    if (vHasEnDash > 0)
        {vErrorMsg = vErrorMsg + "- Part Number cannot contain an 'En Dash' (use a standard hyphen instead).\r\n";}
    if (vHasEmDash > 0)
        {vErrorMsg = vErrorMsg + "- Part Number cannot contain an 'Em Dash' (use a standard hyphen instead).\r\n";}
    vErrorMsg = vErrorMsg + "\n\nASCII: " + vASCIIValue + "\r\n[BPM: Erp.BO.Part.Update] ";
    }

Yes.

Go vote.

Dear Epicor, it’s time to abandon leading spaces as valid characters - Kinetic ERP - Epicor User Help Forum

Just had this topic come up this morning and appreciate the information shared so far.

Prior to 2025.2 we used to run a conversion workbench task UpdateTrailingSpaces monthly. I’ve never run it myself but know of it because of the preexisting monthly helpdesk task.

Turns out it hasnt been run since our upgrade because it is no longer offered in the list.

Based on this post it seems safe to say that trailing & leading spaces can still be an issue unless some out of the box action is taken.

Second question would be is anyone else familiar with UpdateTrailingSpaces from Conversion Workbench?

I’d already voted, but it’s still “Gauging Interest” with 171 votes. Keep those cards and letters coming boys and girls!

Looks like its a

Excited So Close GIF by The Bachelor

1 Like

Isn’t that the current release?

Well, at least it sounds like it was accepted. I don’t have access to that anymore.

2026.100 is the current release so i am guessing the admin comment was put on before EPICOR changed their versioning again :dumpster_fire:

Gotta get a few things done then I can jump into PILOT and test our 26.100