Check if new PartNum is uppercase

I’m trying to check if a new part being created is all upper case.

But a condition statement of
The ProposedPartNum argument/variable is equal to the BpmFunc.ToUpper(ProposedPartNum) expression

Always returns true.

changing the BpmFunc.ToUpper(ProposedPartNum) expression to "TEST-1234"

also returns true when the ProposedPartNum (the parameter of the BPM) is “test-1234”

In a nut shell … “test-1234” == “TEST-1234” is true, when I want tit to be false.

use string.Compare(string, string, false)

1 Like

What does that return?
Looks like the result is a string, but I’m looking for a boolean (if the two are EXACTLY equal).

2 Likes

You can also use Linq to test this and also avoid creating a new string just to test the old one. Note that I put the extra space in “( c )” to keep the web site from converting them to ©. Jose, how do we get around that? :slight_smile:

bool isUpperCase = ProposedPartNum.Where(c => char.IsLetter( c )).All(c => char.IsUpper( c ));

3 Likes

Label your code with 3 ‘’’ (ticks not single quotes) before and after

I have an answer for SQL. Epicor DB is deliberately case insensitive by design. In E9, DMT imports created some instances of Plant field in UPPER due to user error. E9 didn’t care, and the records could still be found on all entry screens. When I upgraded to 10.0 early on when it was released, had problems where some screens were honouring the case and therefore not finding certain records.

select count(*) from Erp.JobHead
where Plant <> ‘MfgSys’ COLLATE SQL_Latin1_General_CP1_CS_AS

By putting the COLLATE statement into a search, I was able to find instances of case difference.