PartNum trailing spaces

What is Epicor’s strategy with trailing spaces on part numbers? We have about 40 partnums that have a trailing space on it, but Epicor seems to treat them the same as without a trailing space.

Ex: BAQ query shows "116227L18 " as the part number with the trailing space. When I go to part entry, I entered “116227L18” and clicked tab. It pulls in the part with the trailing space!


We’ve marked our parts with leading spaces as inactive, and created correcting part numbers for those. But for the trailing space, I tried creating a new part with just “116227L18” and Epicor barks that the part number exists already…

Should we just ignore the trailing space part numbers, since they can’t seem to be fixed?


I just checked, and none of the Part.PartNum records have a trailing space.

Do all of the PartNum’s returned by the BAQ have a trailing space, or just some?

What do you see if you put the table criteria

 PartNum LIKE '% ' expression

(Notice the space after the %.)

I get zero records.

Here’s what I have as my BAQ:

	[Part].[PartNum] as [Part_PartNum],
	[Part].[PartDescription] as [Part_PartDescription],
	[Part].[InActive] as [Part_InActive]
from Erp.Part as Part
 where (Part.PartNum like '" %"'  or Part.PartNum like '"% "')

Hmmm… When I created the BAQ as noted in my post above, it creates the following Query Phrase

	[Part].[PartNum] as [Part_PartNum]
from Erp.Part as Part
 where (Part.PartNum like '% ')

Mine has no double quotes.

I changed the expression to match yours, for:

	[Part].[PartNum] as [Part_PartNum]
from Erp.Part as Part
 where (Part.PartNum like '"% "')

Which also runs, but returns no records.

I suggest contacting support.

My guess is that the BO method to check for existing probably trims whitespace.


Epicor has a Data Fix for Trailing spaces. Whether it fixes it or not is different story. Here is the name of the download zip I had in my Epicor Case. and the name of file that is installed is FX_Upd_TrailingSpaces.df


Thanks guys. Caleb - I’ll check in with Epicor on that data fix.

I always forget what level of quotes I need where - none, single, or double. BAQ’s vs BPM’s vs SQL :stuck_out_tongue:


Bringing this one back from the dead (Glad to see I’m getting to something that bothered me 5 years ago!).

We run the ‘Update Trailing Spaces’ user run conversion monthly, but I’d like to prevent it in the first place.

How do I add TRIM () to my Part in-trans data directive to trim leading and trailing spaces? I’m not sure how to set up the syntax to do everything. Just add .Trim() after? Or make it a second line? Or something else? Safe to do? Will it break bar code scanners (I can’t image folks loading new part numbers that way…)




@Chris_Conn - Found your response to this thread: Strip out spaces from tracking number - #9 by Chris_Conn

I just created the BPM to force upper case, which works like a charm:


Just add .Trim() after should work. Is it not passing the syntax check?

@Banderson - That was way too easy. Thanks! It kills me to create a bunch of BPM’s to uppercase and trim spaces all around Epicor, but it works, and is quick.

1 Like

Now test it for the non-breaking space character (ASCII 160d).

I find that most of the offending characters that work their way into the DB are due to copy and paste from websites and PDF’s.

Space: Normal ( ) is ASCII 32d, Non-Breaking ( ) is 160d
Dash: Normal (-) is 45d, : en dash () is 150d and em dash () is 151d
Quote: Normal (") is 33d, Fancy open () is 147d, fancy closed () is 148d

Update - I tested adding .ToUpper().Trim() to the Warehouse BinNum as an In-trans Data Directive using ‘Set the … Changed Row to the … expression’ . It works almost too well. It also changes existing bins that were in lowercase to uppercase, just by opening them in Warehouse Bin Entry.

Is that good, or bad? I like that it cleans it up, but are there pitfalls with that (i.e. some partbin record recorded in lowercase won’t match the warehouse bin number exactly, since it’s in a different case)? Or am I overthinking it?

I can change the action to ‘Added’ instead of ‘Changed’, and it won’t update the existing records.