So after a little digging, what its really doing is adding a data column to the dataset, not just the grid, the mes form sees this as a change and calls the labor.update method. Using a trace you can actually see the column and the data (it puts it at the end after the rowID!). Not sure if there is a method to just add it to the grid view of a native grid and NOT the dataset...
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/>
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Rob Bucek
Sent: Monday, July 23, 2012 3:56 PM
To: vantage@yahoogroups.com
Subject: [Vantage] RE: adding column to main MES screen - update
Ok.. so I kind of figured that I wasn't properly passing the multiple parameters I need to the function correctly.. I have that figured out. However I'm still getting that odd error message regarding "invalid to modify a transaction..." See code below;
Private Sub AddPartNum()
For Each dr As DataRow In edvLaborDtl.dataView.Table.Rows
If Not IsDBNull(dr("JobNum")) Then
dr("PartNum") = getPartNum(dr("JobNum"), dr("AssemblySeq"))
End If
Next
End Sub
Private Function getPartNum(ByVal job As String, ByVal Assy As String) As String
Dim PartNum As String
Dim recordSelected As Boolean
Dim showSearch As Boolean = False
Dim whereClause As String = "JobNum = '" + Job + "' and AssemblySeq = " + Assy.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@...<mailto:1.234354861%40web65412.mail.ac4.yahoo.com>]<http://www.dsmfg.com/>
(Click the logo to view our site)<http://www.dsmfg.com/>
From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf Of Rob Bucek
Sent: Monday, July 23, 2012 2:19 PM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] adding column to main MES screen
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@...<mailto:1.234354861%40web65412.mail.ac4.yahoo.com><mailto:1.234354861%40web65412.mail.ac4.yahoo.com>]<http://www.dsmfg.com/>
(Click the logo to view our site)<http://www.dsmfg.com/>
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
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/>
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Rob Bucek
Sent: Monday, July 23, 2012 3:56 PM
To: vantage@yahoogroups.com
Subject: [Vantage] RE: adding column to main MES screen - update
Ok.. so I kind of figured that I wasn't properly passing the multiple parameters I need to the function correctly.. I have that figured out. However I'm still getting that odd error message regarding "invalid to modify a transaction..." See code below;
Private Sub AddPartNum()
For Each dr As DataRow In edvLaborDtl.dataView.Table.Rows
If Not IsDBNull(dr("JobNum")) Then
dr("PartNum") = getPartNum(dr("JobNum"), dr("AssemblySeq"))
End If
Next
End Sub
Private Function getPartNum(ByVal job As String, ByVal Assy As String) As String
Dim PartNum As String
Dim recordSelected As Boolean
Dim showSearch As Boolean = False
Dim whereClause As String = "JobNum = '" + Job + "' and AssemblySeq = " + Assy.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@...<mailto:1.234354861%40web65412.mail.ac4.yahoo.com>]<http://www.dsmfg.com/>
(Click the logo to view our site)<http://www.dsmfg.com/>
From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf Of Rob Bucek
Sent: Monday, July 23, 2012 2:19 PM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] adding column to main MES screen
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@...<mailto:1.234354861%40web65412.mail.ac4.yahoo.com><mailto:1.234354861%40web65412.mail.ac4.yahoo.com>]<http://www.dsmfg.com/>
(Click the logo to view our site)<http://www.dsmfg.com/>
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]
[Non-text portions of this message have been removed]