Epicor have confirmed a bug in the system which does not record to the LaborDtl table if only a Scrap or Non-Conformance quantity is entered without a Production Quantity. As this can happen in our production on occasion I am trying to prevent scrap being entered without a production quantity. I don't think this can be done on a BPM as I've tried various methods but although the exception message pops up the Kanban Receipt still processes so I'm trying to customise the form instead. I have the following code but when I run it I get a message saying 'Cannot set ScrapQty.' - we're on Vantage 8.03.409a. Thanks.
Private Sub KanbanReceipts_AfterFieldChange(ByVal sender As object, ByVal args As DataColumnChangeEventArgs) Handles KanbanReceipts_Column.ColumnChanged
'// ** Argument Properties and Uses **
'// args.Row("[FieldName]")
'// args.Column, args.ProposedValue, args.Row
'
'Add Event Handler Code
'
Select Case args.Column.ColumnName
Case "ScrapQuantity"
MsgBox("Production Quantity is mandatory when entering a Scrap Quantity!")
Dim txtScrapQty As EpiNumericEditor = ctype(csm.GetNativeControlReference("03f266c4-a4ec-4276-a448-6e3688825f84"),EpiNumericEditor)
Dim txtProdQty As EpiNumericEditor = ctype(csm.GetNativeControlReference("b841d937-c0c5-4758-bcfe-151b0c996cf2"),EpiNumericEditor)
Dim [edvVarName] As EpiDataView = CType(oTrans.EpiDataViews("kanbanView"), EpiDataView)
Dim [VarName] As Decimal = [edvVarName].dataView([edvVarName].Row)("ScrapQuantity")
edvVarName.dataView(edvVarName.Row)("ScrapQty") = ""
txtProdQty.Focus
Case Else
End Select
End Sub
Private Sub KanbanReceipts_AfterFieldChange(ByVal sender As object, ByVal args As DataColumnChangeEventArgs) Handles KanbanReceipts_Column.ColumnChanged
'// ** Argument Properties and Uses **
'// args.Row("[FieldName]")
'// args.Column, args.ProposedValue, args.Row
'
'Add Event Handler Code
'
Select Case args.Column.ColumnName
Case "ScrapQuantity"
MsgBox("Production Quantity is mandatory when entering a Scrap Quantity!")
Dim txtScrapQty As EpiNumericEditor = ctype(csm.GetNativeControlReference("03f266c4-a4ec-4276-a448-6e3688825f84"),EpiNumericEditor)
Dim txtProdQty As EpiNumericEditor = ctype(csm.GetNativeControlReference("b841d937-c0c5-4758-bcfe-151b0c996cf2"),EpiNumericEditor)
Dim [edvVarName] As EpiDataView = CType(oTrans.EpiDataViews("kanbanView"), EpiDataView)
Dim [VarName] As Decimal = [edvVarName].dataView([edvVarName].Row)("ScrapQuantity")
edvVarName.dataView(edvVarName.Row)("ScrapQty") = ""
txtProdQty.Focus
Case Else
End Select
End Sub