I know this has been on here quite a bit, I didn't have any trouble adding the column to the production grid view to bring in the assembly part number. However, when clocking into more than one job/assy/oper, the part number stays the same for the additional rows added, AND when I click on a row to select it for end activity I get the error "Invalid to modify a transaction that has been submitted for approval".
Has anyone added columns to this grid view and had the same issue?
My code below.. (9.05.700b)
Module Script
'// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
'// Begin Wizard Added Module Level Variables **
Private WithEvents LaborDtl_DataView As DataView
Private WithEvents oTrans_adapter As EpiBaseAdapter
'// End Wizard Added Module Level Variables **
'// Add Custom Module Level Variables Here **
Private WithEvents edvLaborDtl As EpiDataView
Private Sub MESMenu_Load(ByVal sender As object, ByVal args As EventArgs) Handles MESMenu.Load
btnDispatch = CType(csm.GetNativeControlReference("2554a0ec-5dbc-408e-9099-974888c49342"), EpiButton)
btnDispatch.Enabled = True
End Sub
Sub InitializeCustomCode()
' ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
' Begin Wizard Added Variable Initialization
Script.edvLaborDtl = CType(Script.oTrans.EpiDataViews("LaborDtl"),EpiDataView)
AddHandler Script.edvLaborDtl.EpiViewNotification, AddressOf Script.edvLaborDtl_EpiViewNotification
Script.oTrans_adapter = CType(Script.csm.TransAdaptersHT("oTrans_adapter"),EpiBaseAdapter)
'AddHandler Script.oTrans_adapter.AfterAdapterMethod, AddressOf Script.oTrans_adapter_AfterAdapterMethod
' End Wizard Added Variable Initialization
' Begin Wizard Added Custom Method Calls
' End Wizard Added Custom Method Calls
edvLaborDtl = CType(oTrans.EpiDataViews("LaborDtl"), EpiDataView)
if Not (edvLaborDtl.DataView.Table.Columns.Contains("PartNum")) Then
edvLaborDtl.DataView.Table.Columns.Add(new DataColumn("PartNum"))
End if
End Sub
Private Sub edvLaborDtl_EpiViewNotification(ByVal view As EpiDataView, ByVal args As EpiNotifyArgs)
' ** Argument Properties and Uses **
' view.dataView(args.Row)("FieldName")
' args.Row, args.Column, args.Sender, args.NotifyType
' NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
If (args.NotifyType = EpiTransaction.NotifyType.Initialize) Then
If (args.Row > -1) Then
'messagebox.show("test")
addPartNum()
End If
End If
End Sub
Private Sub AddPartNum()
For Each dr As DataRow In edvLaborDtl.dataView.Table.Rows
If Not IsDBNull(dr("JobNum")) Then
dr("PartNum") = getPartNum(dr("JobNum"))
oTrans.Refresh()
End If
Next
End Sub
Private Function getPartNum(ByVal job As String) As String
Dim PartNum As String
Dim JobNum As String
Dim AssyNum As Integer
JobNum = edvLaborDtl.DataView(edvLaborDtl.Row)("JobNum")
AssyNum = edvLaborDtl.DataView(edvLaborDtl.Row)("AssemblySeq")
Dim recordSelected As Boolean
Dim showSearch As Boolean = False
Dim whereClause As String = "JobNum = '" + JobNum + "' and AssemblySeq = " + AssyNum.tostring()
Dim dsJobInfo As DataSet = SearchFunctions.listLookup(MESMenu, "JobAsmSearchAdapter", recordSelected, showSearch, whereClause)
If recordSelected Then
PartNum = dsJobInfo.Tables(0).Rows(0)("PartNum").ToString()
Else
PartNum = ""
End If
Return PartNum
End Function
Rob Bucek
Production Control Manager
PH: (715) 284-5376 ext 311
Mobile: (715)896-0590
FAX: (715)284-4084
[Description: cid:1.234354861@...]<http://www.dsmfg.com/>
(Click the logo to view our site)<http://www.dsmfg.com/>
[Non-text portions of this message have been removed]
Has anyone added columns to this grid view and had the same issue?
My code below.. (9.05.700b)
Module Script
'// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
'// Begin Wizard Added Module Level Variables **
Private WithEvents LaborDtl_DataView As DataView
Private WithEvents oTrans_adapter As EpiBaseAdapter
'// End Wizard Added Module Level Variables **
'// Add Custom Module Level Variables Here **
Private WithEvents edvLaborDtl As EpiDataView
Private Sub MESMenu_Load(ByVal sender As object, ByVal args As EventArgs) Handles MESMenu.Load
btnDispatch = CType(csm.GetNativeControlReference("2554a0ec-5dbc-408e-9099-974888c49342"), EpiButton)
btnDispatch.Enabled = True
End Sub
Sub InitializeCustomCode()
' ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Initialization' lines **
' Begin Wizard Added Variable Initialization
Script.edvLaborDtl = CType(Script.oTrans.EpiDataViews("LaborDtl"),EpiDataView)
AddHandler Script.edvLaborDtl.EpiViewNotification, AddressOf Script.edvLaborDtl_EpiViewNotification
Script.oTrans_adapter = CType(Script.csm.TransAdaptersHT("oTrans_adapter"),EpiBaseAdapter)
'AddHandler Script.oTrans_adapter.AfterAdapterMethod, AddressOf Script.oTrans_adapter_AfterAdapterMethod
' End Wizard Added Variable Initialization
' Begin Wizard Added Custom Method Calls
' End Wizard Added Custom Method Calls
edvLaborDtl = CType(oTrans.EpiDataViews("LaborDtl"), EpiDataView)
if Not (edvLaborDtl.DataView.Table.Columns.Contains("PartNum")) Then
edvLaborDtl.DataView.Table.Columns.Add(new DataColumn("PartNum"))
End if
End Sub
Private Sub edvLaborDtl_EpiViewNotification(ByVal view As EpiDataView, ByVal args As EpiNotifyArgs)
' ** Argument Properties and Uses **
' view.dataView(args.Row)("FieldName")
' args.Row, args.Column, args.Sender, args.NotifyType
' NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
If (args.NotifyType = EpiTransaction.NotifyType.Initialize) Then
If (args.Row > -1) Then
'messagebox.show("test")
addPartNum()
End If
End If
End Sub
Private Sub AddPartNum()
For Each dr As DataRow In edvLaborDtl.dataView.Table.Rows
If Not IsDBNull(dr("JobNum")) Then
dr("PartNum") = getPartNum(dr("JobNum"))
oTrans.Refresh()
End If
Next
End Sub
Private Function getPartNum(ByVal job As String) As String
Dim PartNum As String
Dim JobNum As String
Dim AssyNum As Integer
JobNum = edvLaborDtl.DataView(edvLaborDtl.Row)("JobNum")
AssyNum = edvLaborDtl.DataView(edvLaborDtl.Row)("AssemblySeq")
Dim recordSelected As Boolean
Dim showSearch As Boolean = False
Dim whereClause As String = "JobNum = '" + JobNum + "' and AssemblySeq = " + AssyNum.tostring()
Dim dsJobInfo As DataSet = SearchFunctions.listLookup(MESMenu, "JobAsmSearchAdapter", recordSelected, showSearch, whereClause)
If recordSelected Then
PartNum = dsJobInfo.Tables(0).Rows(0)("PartNum").ToString()
Else
PartNum = ""
End If
Return PartNum
End Function
Rob Bucek
Production Control Manager
PH: (715) 284-5376 ext 311
Mobile: (715)896-0590
FAX: (715)284-4084
[Description: cid:1.234354861@...]<http://www.dsmfg.com/>
(Click the logo to view our site)<http://www.dsmfg.com/>
[Non-text portions of this message have been removed]