Hello. Not sure what I am doing wrong. I need to prevent users from
entering a need by date on the Order Entry screen that is less than 4
weeks away. The Tools book I purchased from Epicor (page 97) says to use
the following code and it does work by showing an error message but the
user is still allowed to save the incorrect date. Page 122 of the Tools
book says to add "Throw New EpiUIException() When the Validation
condition is met" to the code to prevent users from leaving a field that
is not validated. However, I've tried with no luck. Can someone tell me
where to insert this code into the following and if I need to add
anything else to it? Thanks!
Private Sub OrderDtl_BeforeFieldChange(ByVal sender As object, ByVal
args As DataColumnChangeEventArgs) Handles
OrderDtl_Column.ColumnChanging
'// ** Argument Properties and Uses **
'// args.Row("[FieldName]")
'// args.Column, args.ProposedValue, args.Row
'
'Add Event Handler Code
'
Select Case args.Column.ColumnName
Case "NeedByDate"
If Ctype(args.proposedvalue, System.DateTime) <
System.DateTime.Today.AddDays(30)
Then messagebox.show ("Need By Date is less than 4 weeks away. Please
enter a valid date")
End If
Case Else
End Select
End Sub
Dawn Stenbol
IT Manager
Wiza Industries
Muskego, WI
[Non-text portions of this message have been removed]
entering a need by date on the Order Entry screen that is less than 4
weeks away. The Tools book I purchased from Epicor (page 97) says to use
the following code and it does work by showing an error message but the
user is still allowed to save the incorrect date. Page 122 of the Tools
book says to add "Throw New EpiUIException() When the Validation
condition is met" to the code to prevent users from leaving a field that
is not validated. However, I've tried with no luck. Can someone tell me
where to insert this code into the following and if I need to add
anything else to it? Thanks!
Private Sub OrderDtl_BeforeFieldChange(ByVal sender As object, ByVal
args As DataColumnChangeEventArgs) Handles
OrderDtl_Column.ColumnChanging
'// ** Argument Properties and Uses **
'// args.Row("[FieldName]")
'// args.Column, args.ProposedValue, args.Row
'
'Add Event Handler Code
'
Select Case args.Column.ColumnName
Case "NeedByDate"
If Ctype(args.proposedvalue, System.DateTime) <
System.DateTime.Today.AddDays(30)
Then messagebox.show ("Need By Date is less than 4 weeks away. Please
enter a valid date")
End If
Case Else
End Select
End Sub
Dawn Stenbol
IT Manager
Wiza Industries
Muskego, WI
[Non-text portions of this message have been removed]