try a application.doevents or something that will refresh the view. I have always had trouble with auto-clearing and checking of form elements such as checkboxes and drop down menus. I tend to write directly to the database row (if it exists) instead of manipulating the form element and refresh. There might be a easier way though.
Thanks,
Kunal
________________________________
From: rob.bucek <rob.bucek@...>
To: vantage@yahoogroups.com
Sent: Wednesday, March 18, 2009 1:16:23 PM
Subject: [Vantage] vbnet customization
i have a customization based on a field change (specifically a checkbox). If the user checks the box and answers yes to the msgbox that appears things will happen. If he answers no i would like the chkbox to clear and the script to end. Im having trouble with clearing the checkbox, the rest works great. any thoughts?
Private Sub JobClosing_BeforeFi eldChange( ByVal sender As object, ByVal args As DataColumnChangeEve ntArgs) Handles JobClosing_Column. ColumnChanging
'// ** Argument Properties and Uses **
'// args.Row("[FieldNam e]")
'// args.Column, args.ProposedValue, args.Row
'
'Add Event Handler Code
'
Select Case args.Column. ColumnName
Case "JobComplete"
Dim edvClose As EpiDataView = CType(oTrans. EpiDataViews( "Close"), EpiDataView)
Dim intSTK As Integer = edvClose.dataView( edvClose. Row)("StockQty" )
Dim strJobNum As String = edvClose.dataView( edvClose. Row)("JobNum" )
If intSTK > 0 Then
Dim response As MsgboxResult
Dim msg As String = "Has Inventory/WIP Reconciliation been run against this job?"
Dim title As String = "Costing."
response = MsgBox(msg, MsgBoxStyle. YesNo, title)
if response = MsgboxResult. yes then
UpdateJob()
Else
Dim chkCmplt As EpiCheckBox = ctype(csm.GetNative ControlReference ("811d9992- afdf-4597- b91c-78d663d436a a"),EpiCheckBox)
Dim vComplete As Boolean = edvClose.dataView( edvClose. Row)("JobComplet e")
vComplete = 0
chkCmplt.CheckedVal ue = False
End If
End If
Case Else
End Select
End Sub
Private Sub UpdateJob()
Dim edvClose As EpiDataView = CType(oTrans. EpiDataViews( "Close"), EpiDataView)
'Dim vProcID As Boolean = edvNC.dataView( edvNC.Row) ("ShortChar01" )
Dim vJobNum as String = edvClose.dataView( edvClose. Row)("JobNum" )
Dim adpJobEntry As JobEntryAdapter = New JobEntryAdapter( JobClosingForm)
adpJobEntry. BOConnect( )
Try
Dim JobNum As Boolean = adpJobEntry. GetByID(vJobNum)
adpJobEntry. JobEntryData. Tables("JobHead" ).Rows(0) .BeginEdit( )
adpJobEntry. JobEntryData. JobHead(0) ("CheckBox01" ) = True
adpJobEntry. JobEntryData. Tables("JobHead" ).Rows(0) .EndEdit( )
adpJobEntry. Update()
Catch e As Exception
'AddNewDraw( )
Finally
adpJobEntry. Dispose()
End Try
End Sub
[Non-text portions of this message have been removed]
Thanks,
Kunal
________________________________
From: rob.bucek <rob.bucek@...>
To: vantage@yahoogroups.com
Sent: Wednesday, March 18, 2009 1:16:23 PM
Subject: [Vantage] vbnet customization
i have a customization based on a field change (specifically a checkbox). If the user checks the box and answers yes to the msgbox that appears things will happen. If he answers no i would like the chkbox to clear and the script to end. Im having trouble with clearing the checkbox, the rest works great. any thoughts?
Private Sub JobClosing_BeforeFi eldChange( ByVal sender As object, ByVal args As DataColumnChangeEve ntArgs) Handles JobClosing_Column. ColumnChanging
'// ** Argument Properties and Uses **
'// args.Row("[FieldNam e]")
'// args.Column, args.ProposedValue, args.Row
'
'Add Event Handler Code
'
Select Case args.Column. ColumnName
Case "JobComplete"
Dim edvClose As EpiDataView = CType(oTrans. EpiDataViews( "Close"), EpiDataView)
Dim intSTK As Integer = edvClose.dataView( edvClose. Row)("StockQty" )
Dim strJobNum As String = edvClose.dataView( edvClose. Row)("JobNum" )
If intSTK > 0 Then
Dim response As MsgboxResult
Dim msg As String = "Has Inventory/WIP Reconciliation been run against this job?"
Dim title As String = "Costing."
response = MsgBox(msg, MsgBoxStyle. YesNo, title)
if response = MsgboxResult. yes then
UpdateJob()
Else
Dim chkCmplt As EpiCheckBox = ctype(csm.GetNative ControlReference ("811d9992- afdf-4597- b91c-78d663d436a a"),EpiCheckBox)
Dim vComplete As Boolean = edvClose.dataView( edvClose. Row)("JobComplet e")
vComplete = 0
chkCmplt.CheckedVal ue = False
End If
End If
Case Else
End Select
End Sub
Private Sub UpdateJob()
Dim edvClose As EpiDataView = CType(oTrans. EpiDataViews( "Close"), EpiDataView)
'Dim vProcID As Boolean = edvNC.dataView( edvNC.Row) ("ShortChar01" )
Dim vJobNum as String = edvClose.dataView( edvClose. Row)("JobNum" )
Dim adpJobEntry As JobEntryAdapter = New JobEntryAdapter( JobClosingForm)
adpJobEntry. BOConnect( )
Try
Dim JobNum As Boolean = adpJobEntry. GetByID(vJobNum)
adpJobEntry. JobEntryData. Tables("JobHead" ).Rows(0) .BeginEdit( )
adpJobEntry. JobEntryData. JobHead(0) ("CheckBox01" ) = True
adpJobEntry. JobEntryData. Tables("JobHead" ).Rows(0) .EndEdit( )
adpJobEntry. Update()
Catch e As Exception
'AddNewDraw( )
Finally
adpJobEntry. Dispose()
End Try
End Sub
[Non-text portions of this message have been removed]