Control Part Number Format

> I need a way to restrict the format of part numbers as they are entered
> into Part Entry.
....
> Only numbers, capital letters, and hyphens are allowed.
....
> Before I recreate the wheel, does anyone have a BPM or customization
> that performs these type of checks before saving that they would be
> willing to share?

This is what regular expressions are for! You create a pattern that a string
must follow. Here's a reference for doing regular expressions in .Net:

http://www.regular-expressions.info/dotnet.html

An MSDN article:
http://msdn.microsoft.com/en-us/library/ms974570.aspx

A program to test your own regular expressions:
http://www.devcity.net/Articles/22/1/20020308.aspx

You should be able to create a regular expression and test to see if a part
matches in a customization. Progress has a MATCHES function but it is not
nearly as powerful as regular expressions.

Mark W.
Hello,



I need a way to restrict the format of part numbers as they are entered
into Part Entry.

We have, on paper, data entry rules for Part Numbers.

Only numbers, capital letters, and hyphens are allowed.



The problem is that some people are not following the rules.



Before I recreate the wheel, does anyone have a BPM or customization
that performs these type of checks before saving that they would be
willing to share?



Joe Rojas

Information Technology Manager

Symmetry Medical New Bedford

P: 508.998.4575

C:508.838.4717

F:508.995.9597

joe.rojas@... <mailto:joe.rojas@...>





[Non-text portions of this message have been removed]
Hi Joe,

It's not quite what you asked for, but it might start you off:

I have a customisation on the creation of new Customers. I like all CustIDs to be in capitals and I don't like apostrophes - back in 8.0 they caused a problem, so I added a "BeforeFieldChange" event and added in the following code:

Select Case args.Column.ColumnName

Case "CustID"
' Convert Account Ref to Uppercase
args.ProposedValue = args.ProposedValue.ToUpper()
if InStr(1, args.ProposedValue.ToString(), "'", CompareMethod.Text) > 0 then
messagebox.show("Don't use an Apostrophe in a Customer Code." + chr(13) + "Please delete this record and re-enter.", "Error.", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
Case Else

End Select

You could easily stick in a loop to check each that character in args.ProposedValue is of the proper format. I never looked into actually stopping the user continuing, but, as I said it might start you off.

Nigel.



________________________________

From: vantage@yahoogroups.com on behalf of Rojas, Joe
Sent: Mon 02/06/2008 18:25
To: vantage@yahoogroups.com
Subject: [Vantage] Control Part Number Format



Hello,

I need a way to restrict the format of part numbers as they are entered
into Part Entry.

We have, on paper, data entry rules for Part Numbers.

Only numbers, capital letters, and hyphens are allowed.

The problem is that some people are not following the rules.

Before I recreate the wheel, does anyone have a BPM or customization
that performs these type of checks before saving that they would be
willing to share?

Joe Rojas

Information Technology Manager

Symmetry Medical New Bedford

P: 508.998.4575

C:508.838.4717

F:508.995.9597

joe.rojas@... <mailto:joe.rojas%40symmetrynb.com> <mailto:joe.rojas@... <mailto:joe.rojas%40symmetrynb.com> >

[Non-text portions of this message have been removed]







----------

Hi Joe,

It's not quite what you asked for, but it might start you off:

I have a customisation on the creation of new Customers. I like all CustIDs to be in capitals and I don't like apostrophes - back in 8.0 they caused a problem, so I added a "BeforeFieldChange" event and added in the following code:

Select Case args.Column.ColumnName

Case "CustID"
' Convert Account Ref to Uppercase
args.ProposedValue = args.ProposedValue.ToUpper()
if InStr(1, args.ProposedValue.ToString(), "'", CompareMethod.Text) > 0 then
messagebox.show("Don't use an Apostrophe in a Customer Code." + chr(13) + "Please delete this record and re-enter.", "Error.", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
Case Else

End Select

You could easily stick in a loop to check each that character in args.ProposedValue is of the proper format. I never looked into actually stopping the user continuing, but, as I said it might start you off.

Nigel.



________________________________

From: vantage@yahoogroups.com on behalf of Rojas, Joe
Sent: Mon 02/06/2008 18:25
To: vantage@yahoogroups.com
Subject: [Vantage] Control Part Number Format



Hello,

I need a way to restrict the format of part numbers as they are entered
into Part Entry.

We have, on paper, data entry rules for Part Numbers.

Only numbers, capital letters, and hyphens are allowed.

The problem is that some people are not following the rules.

Before I recreate the wheel, does anyone have a BPM or customization
that performs these type of checks before saving that they would be
willing to share?

Joe Rojas

Information Technology Manager

Symmetry Medical New Bedford

P: 508.998.4575

C:508.838.4717

F:508.995.9597

joe.rojas@... <mailto:joe.rojas%40symmetrynb.com> <mailto:joe.rojas@... <mailto:joe.rojas%40symmetrynb.com> >

[Non-text portions of this message have been removed]








[Non-text portions of this message have been removed]