EpiViewNotification Code Assistance Requested

Why not just run it pre-processing on GetByID ? Then you can avoid the FKV
and screen customization all together.



On Tue, Apr 12, 2011 at 1:52 PM, pambro6225 <pam.broviak@...>wrote:

>
>
> Looking for assistance with a Purchase Order Entry customization. I've
> tried BPMs in pre and post process directives, as well as other events as
> suggested in other forum responses, but I'm not able to succeed.
>
> I added a new Inspection Required checkbox (Part.CheckBox05) at the Part
> Maintenance level, and added a PO Update Pre Process BPM that works
> perfectly to check the Inspection Required checkbox
> (PODetail.RcvInspectionReq) on the PO Entry Line screen whenever the same
> part Part Maintenance Inspection Required checkbox is checked.
>
> This works great for new and changed POs added manually via the Purchase
> Order Entry screen, but doesn't work when new POs are created via the
> Generate POs from Suggestions process.
>
> I added a Part foreign key view linked by PartNum to parent view PODetail,
> and added field Part.CheckBox05 to the Part FKV. I then added an extra
> checkbox to the PO Entry Line screen using FKV Part.CheckBox05 as the
> datasource. The new checkbox is checked on the screen when it's supposed to
> be, but it doesn't trigger the Inspection Required checkbox to be checked
> when FKV Part.CheckBox05 = True, which is my goal.
>
> If someone familiar with this has time could they please take a look at my
> Form Event EpiViewNotification code below and see what changes I would need
> to make to get this to work correctly?
>
> Thanks in advance - Pam
>
> '//**************************************************
> '// Custom VB.NET code for POEntryForm
> '// Created: 9/6/2007 2:07:40 PM
> '//**************************************************
> Imports System
> Imports System.Data
> Imports System.Diagnostics
> Imports System.Windows.Forms
> Imports System.ComponentModel
> Imports Microsoft.VisualBasic
> Imports Epicor.Mfg.UI
> Imports Epicor.Mfg.UI.FrameWork
> Imports Epicor.Mfg.UI.ExtendedProps
> Imports Epicor.Mfg.UI.FormFunctions
> Imports Epicor.Mfg.UI.Customization
> Imports Epicor.Mfg.UI.Adapters
> Imports Epicor.Mfg.UI.Searches
> Imports Epicor.Mfg.BO
>
> Module Script
>
> '// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added
> Module Level Variables' Comments! **
> '// Begin Wizard Added Module Level Variables **
>
> Private WithEvents edvPODetail As EpiDataView
> Private WithEvents edvPart As EpiDataView
> Private WithEvents chkEpiCustom1 As EpiCheckBox
> Private WithEvents chkInspectionRequired As EpiCheckBox
> '// End Wizard Added Module Level Variables **
>
> '// Add Custom Module Level Variables Here **
>
> Sub InitializeCustomCode()
>
> '// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added
> Variable Intialization' lines **
> '// Begin Wizard Added Variable Intialization
>
> edvPODetail = CType(oTrans.EpiDataViews("PODetail"), EpiDataView)
> edvPart = CType(oTrans.EpiDataViews("Part"), EpiDataView)
> '// End Wizard Added Variable Intialization
> '// Begin Custom Method Calls
>
> '// End Custom Method Calls
> End Sub
>
> Sub DestroyCustomCode()
>
> '// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added
> Object Disposal' lines **
> '// Begin Wizard Added Object Disposal
>
> '// edvPODetail = Nothing
> '// End Wizard Added Object Disposal
> '// Begin Custom Code Disposal
>
> '// End Custom Code Disposal
> End Sub
>
> Private Sub edvPODetail_EpiViewNotification(view As EpiDataView, args As
> EpiNotifyArgs) Handles edvPODetail.EpiViewNotification
> '// ** 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
>
> '// edvPart = CType(oTrans.EpiDataViews("Part"), EpiDataView)
> '// edvPODetail = CType(oTrans.EpiDataViews("PODetail"), EpiDataView)
>
> chkEpiCustom1 =
> CType(csm.GetNativeControlReference("49968fd7-658e-444a-b8a4-a10e30ca1bf0"),EpiCheckBox)
> chkInspectionReq =
> CType(csm.GetNativeControlReference("6c0686e9-1d15-48d3-83dd-dbe108176af8"),EpiCheckBox)
>
> If (args.NotifyType = EpiTransaction.NotifyType.AddRow) and
> edvPart.dataview(edvPart.Row)("CheckBox05") = True Then
>
> '// edvPODetail.dataview(edvPODetail.Row)("RcvInspectionReq") =
> edvPart.dataview(edvPart.Row)("CheckBox05")
>
> edvPODetail.dataview(edvPODetail.Row)("RcvInspectionReq").Checked = True
>
> End If
> End Sub
>
> End Module
>
>
>


[Non-text portions of this message have been removed]
Looking for assistance with a Purchase Order Entry customization. I've tried BPMs in pre and post process directives, as well as other events as suggested in other forum responses, but I'm not able to succeed.

I added a new Inspection Required checkbox (Part.CheckBox05) at the Part Maintenance level, and added a PO Update Pre Process BPM that works perfectly to check the Inspection Required checkbox (PODetail.RcvInspectionReq) on the PO Entry Line screen whenever the same part Part Maintenance Inspection Required checkbox is checked.

This works great for new and changed POs added manually via the Purchase Order Entry screen, but doesn't work when new POs are created via the Generate POs from Suggestions process.

I added a Part foreign key view linked by PartNum to parent view PODetail, and added field Part.CheckBox05 to the Part FKV. I then added an extra checkbox to the PO Entry Line screen using FKV Part.CheckBox05 as the datasource. The new checkbox is checked on the screen when it's supposed to be, but it doesn't trigger the Inspection Required checkbox to be checked when FKV Part.CheckBox05 = True, which is my goal.

If someone familiar with this has time could they please take a look at my Form Event EpiViewNotification code below and see what changes I would need to make to get this to work correctly?

Thanks in advance - Pam


'//**************************************************
'// Custom VB.NET code for POEntryForm
'// Created: 9/6/2007 2:07:40 PM
'//**************************************************
Imports System
Imports System.Data
Imports System.Diagnostics
Imports System.Windows.Forms
Imports System.ComponentModel
Imports Microsoft.VisualBasic
Imports Epicor.Mfg.UI
Imports Epicor.Mfg.UI.FrameWork
Imports Epicor.Mfg.UI.ExtendedProps
Imports Epicor.Mfg.UI.FormFunctions
Imports Epicor.Mfg.UI.Customization
Imports Epicor.Mfg.UI.Adapters
Imports Epicor.Mfg.UI.Searches
Imports Epicor.Mfg.BO


Module Script


'// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
'// Begin Wizard Added Module Level Variables **

Private WithEvents edvPODetail As EpiDataView
Private WithEvents edvPart As EpiDataView
Private WithEvents chkEpiCustom1 As EpiCheckBox
Private WithEvents chkInspectionRequired As EpiCheckBox
'// End Wizard Added Module Level Variables **


'// Add Custom Module Level Variables Here **



Sub InitializeCustomCode()


'// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Intialization' lines **
'// Begin Wizard Added Variable Intialization

edvPODetail = CType(oTrans.EpiDataViews("PODetail"), EpiDataView)
edvPart = CType(oTrans.EpiDataViews("Part"), EpiDataView)
'// End Wizard Added Variable Intialization
'// Begin Custom Method Calls

'// End Custom Method Calls
End Sub



Sub DestroyCustomCode()


'// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Object Disposal' lines **
'// Begin Wizard Added Object Disposal

'// edvPODetail = Nothing
'// End Wizard Added Object Disposal
'// Begin Custom Code Disposal

'// End Custom Code Disposal
End Sub



Private Sub edvPODetail_EpiViewNotification(view As EpiDataView, args As EpiNotifyArgs) Handles edvPODetail.EpiViewNotification
'// ** 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

'// edvPart = CType(oTrans.EpiDataViews("Part"), EpiDataView)
'// edvPODetail = CType(oTrans.EpiDataViews("PODetail"), EpiDataView)

chkEpiCustom1 = CType(csm.GetNativeControlReference("49968fd7-658e-444a-b8a4-a10e30ca1bf0"),EpiCheckBox)
chkInspectionReq = CType(csm.GetNativeControlReference("6c0686e9-1d15-48d3-83dd-dbe108176af8"),EpiCheckBox)

If (args.NotifyType = EpiTransaction.NotifyType.AddRow) and edvPart.dataview(edvPart.Row)("CheckBox05") = True Then

'// edvPODetail.dataview(edvPODetail.Row)("RcvInspectionReq") = edvPart.dataview(edvPart.Row)("CheckBox05")

edvPODetail.dataview(edvPODetail.Row)("RcvInspectionReq").Checked = True

End If
End Sub


End Module