Limiting characters of a part number

Hey guys, I need your help. I was trying to do a similar BPM in AR cash receipt entry. My aim is to limit the AR Receipt Check Number by 10 digits. In CashRec.Update, I tried the following code:

for each ttcashdtl where length(ttcashdtl.checkref)>10 and ttcashdtl.RowMod='A'

in condition, query not less than one. But its not working! Please help me.
We are trying to do a BPM that will throw an error when a user tries to
enter a part number that is more that 15 characters. We can't find a
condition using progress code that will cause the action to run. Has
anyone had any experience with this?

thanks,

Greg Deterding
Laclede Chain Co.
636-680-2320 x2358
I'm assuming you are talking about in the part entry screen? The easiest
way is to write a customization that runs when the part.partnum field has
been changed. Your code would be something like this:



Private Sub Part_AfterFieldChange(ByVal sender As object, ByVal args As
DataColumnChangeEventArgs) Handles Part_Column.ColumnChanged

Select Case args.Column.ColumnName



Case "PartNum"

If args.ProposedValue.length > 15 then

messagebox.show("Please enter a part 15 characters or less","Invalid Part
Length",messageboxbuttons.ok,messageboxicon.error)

args.Row("Partnum") = ""

End If

Case Else

End Select

End Sub





Daniel

_____

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
greg.deterding
Sent: Monday, October 27, 2008 12:57 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Limiting characters of a part number



We are trying to do a BPM that will throw an error when a user tries to
enter a part number that is more that 15 characters. We can't find a
condition using progress code that will cause the action to run. Has
anyone had any experience with this?

thanks,

Greg Deterding
Laclede Chain Co.
636-680-2320 x2358





[Non-text portions of this message have been removed]
If you really want to use BPM, you can have your warning message come up
when they try to save. Open method directive: Part.Update. Use
preprocessing condition of :



Query not less than 1 using the code: for each ttpart where
Length(ttpart.partnum) > 15 and ttpart.Rowmod = "A"



Your actions would just be "Raise an exception based on xx template"

Hope this helps, if you have questions feel free to email.

Daniel

_____

From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of
greg.deterding
Sent: Monday, October 27, 2008 12:57 PM
To: vantage@yahoogroups.com
Subject: [Vantage] Limiting characters of a part number



We are trying to do a BPM that will throw an error when a user tries to
enter a part number that is more that 15 characters. We can't find a
condition using progress code that will cause the action to run. Has
anyone had any experience with this?

thanks,

Greg Deterding
Laclede Chain Co.
636-680-2320 x2358





[Non-text portions of this message have been removed]
You may have to use a before_BO_method evnt trigger(Part Entry BO where method is New or Update). Your code may have already allowed the greater than 15 char P/N to be written to the db.

Some apps write key field data immediately in the background upon entry & some don't. I can't recall Part Entry's behavior so this is just a friendly warning of the possibility.

Rob

--- On Mon, 10/27/08, Daniel Laidig <daniellaidig@...> wrote:

From: Daniel Laidig <daniellaidig@...>
Subject: RE: [Vantage] Limiting characters of a part number
To: vantage@yahoogroups.com
Date: Monday, October 27, 2008, 1:19 PM






I'm assuming you are talking about in the part entry screen? The easiest
way is to write a customization that runs when the part.partnum field has
been changed. Your code would be something like this:

Private Sub Part_AfterFieldChan ge(ByVal sender As object, ByVal args As
DataColumnChangeEve ntArgs) Handles Part_Column. ColumnChanged

Select Case args.Column. ColumnName

Case "PartNum"

If args.ProposedValue. length > 15 then

messagebox.show( "Please enter a part 15 characters or less","Invalid Part
Length",messageboxb uttons.ok, messageboxicon. error)

args.Row("Partnum" ) = ""

End If

Case Else

End Select

End Sub

Daniel

_____

From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On Behalf Of
greg.deterding
Sent: Monday, October 27, 2008 12:57 PM
To: vantage@yahoogroups .com
Subject: [Vantage] Limiting characters of a part number

We are trying to do a BPM that will throw an error when a user tries to
enter a part number that is more that 15 characters. We can't find a
condition using progress code that will cause the action to run. Has
anyone had any experience with this?

thanks,

Greg Deterding
Laclede Chain Co.
636-680-2320 x2358

[Non-text portions of this message have been removed]
Thanks, Daniel. Works like a charm! We didn't think to include this all in the where clause.

Greg




Â



________________________________
From: Daniel Laidig <daniellaidig@...>
To: vantage@yahoogroups.com
Sent: Monday, October 27, 2008 12:31:59 PM
Subject: RE: [Vantage] Limiting characters of a part number


If you really want to use BPM, you can have your warning message come up
when they try to save. Open method directive: Part.Update. Use
preprocessing condition of :

Query not less than 1 using the code: for each ttpart where
Length(ttpart. partnum) > 15 and ttpart.Rowmod = "A"

Your actions would just be "Raise an exception based on xx template"

Hope this helps, if you have questions feel free to email.

Daniel

_____

From: vantage@yahoogroups .com [mailto:vantage@yahoogroups .com] On Behalf Of
greg.deterding
Sent: Monday, October 27, 2008 12:57 PM
To: vantage@yahoogroups .com
Subject: [Vantage] Limiting characters of a part number

We are trying to do a BPM that will throw an error when a user tries to
enter a part number that is more that 15 characters. We can't find a
condition using progress code that will cause the action to run. Has
anyone had any experience with this?

thanks,

Greg Deterding
Laclede Chain Co.
636-680-2320 x2358

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






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