Hi,
Does anyone have code for auto generating the Ship To ID in Customer
Maintenance? I already have code to auto generate the Customer ID, but
our sales department has requested that the Ship To ID also be
automatically created.
We are currently running Vantage 8.03 305F. Below is the code I already
have working for the Cust ID auto generate.
'// Custom VB.NET code for CustomerEntryForm
'// Created: 23/03/2007 17:48:39
'//**************************************************
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 edvCustomer As EpiDataView
'// 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
edvCustomer = CType(oTrans.EpiDataViews("Customer"),
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
'// End Wizard Added Object Disposal
'// Begin Custom Code Disposal
'// End Custom Code Disposal
End Sub
Private Function GetNextCustID() As String
'//Use the company Adapter to Store our sequance number Number01
Dim nextCustID As string = String.Empty
Dim companyAdapter As CompanyAdapter = New
CompanyAdapter(CustomerEntryForm)
companyAdapter.BOConnect()
Dim company As String = CustomerEntryForm.Session.CompanyID
Dim found As Boolean = companyAdapter.GetByID(company)
if (found) then
nextCustID =
companyAdapter.CompanyData.Company.Rows(0)("Number01").toString()
companyAdapter.CompanyData.Company.Rows(0).BeginEdit()
companyAdapter.CompanyData.Company.Rows(0)("Number01") += 1
companyAdapter.CompanyData.Company.Rows(0).EndEdit()
companyAdapter.Update()
companyAdapter.Dispose()
end if
return nextCustID
End Function
Private Sub edvCustomer_EpiViewNotification(view As EpiDataView,args
As EpiNotifyArgs)Handles edvCustomer.EpiViewNotification
If (args.NotifyType = EpiTransaction.NotifyType.AddRow) Then
If (args.Row -1) Then
view.dataView(args.Row)("CustID") = GetNextCustID()
view.Notify(New EpiNotifyArgs(CustomerEntryForm, view.Row,
view.Column))
end if
end if
End Sub
End Module
Thank You,
Lauren L. Hellings
Systems Administrator
Ericson Manufacturing Co.
4215 Hamann Parkway
Willoughby, OH 44094
P: (800) ERICSON x263
F: (440) 951-1867
LaurenH@...
http://www.ericson.com/
Confidentiality Notice: This email message, including any attachments,
is for the sole use of the intended recipient (s) and may contain
confidential and privileged information. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by email and delete all copies of
the original message
[Non-text portions of this message have been removed]
Does anyone have code for auto generating the Ship To ID in Customer
Maintenance? I already have code to auto generate the Customer ID, but
our sales department has requested that the Ship To ID also be
automatically created.
We are currently running Vantage 8.03 305F. Below is the code I already
have working for the Cust ID auto generate.
'// Custom VB.NET code for CustomerEntryForm
'// Created: 23/03/2007 17:48:39
'//**************************************************
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 edvCustomer As EpiDataView
'// 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
edvCustomer = CType(oTrans.EpiDataViews("Customer"),
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
'// End Wizard Added Object Disposal
'// Begin Custom Code Disposal
'// End Custom Code Disposal
End Sub
Private Function GetNextCustID() As String
'//Use the company Adapter to Store our sequance number Number01
Dim nextCustID As string = String.Empty
Dim companyAdapter As CompanyAdapter = New
CompanyAdapter(CustomerEntryForm)
companyAdapter.BOConnect()
Dim company As String = CustomerEntryForm.Session.CompanyID
Dim found As Boolean = companyAdapter.GetByID(company)
if (found) then
nextCustID =
companyAdapter.CompanyData.Company.Rows(0)("Number01").toString()
companyAdapter.CompanyData.Company.Rows(0).BeginEdit()
companyAdapter.CompanyData.Company.Rows(0)("Number01") += 1
companyAdapter.CompanyData.Company.Rows(0).EndEdit()
companyAdapter.Update()
companyAdapter.Dispose()
end if
return nextCustID
End Function
Private Sub edvCustomer_EpiViewNotification(view As EpiDataView,args
As EpiNotifyArgs)Handles edvCustomer.EpiViewNotification
If (args.NotifyType = EpiTransaction.NotifyType.AddRow) Then
If (args.Row -1) Then
view.dataView(args.Row)("CustID") = GetNextCustID()
view.Notify(New EpiNotifyArgs(CustomerEntryForm, view.Row,
view.Column))
end if
end if
End Sub
End Module
Thank You,
Lauren L. Hellings
Systems Administrator
Ericson Manufacturing Co.
4215 Hamann Parkway
Willoughby, OH 44094
P: (800) ERICSON x263
F: (440) 951-1867
LaurenH@...
http://www.ericson.com/
Confidentiality Notice: This email message, including any attachments,
is for the sole use of the intended recipient (s) and may contain
confidential and privileged information. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by email and delete all copies of
the original message
[Non-text portions of this message have been removed]