Professional Documents
Culture Documents
Advanced Embedded
Customization Course
9.05.600
Disclaimer
Copyright 2010 by Epicor Software Corporation. All rights reserved. Printed in the United States of America. No part
of this publication may be reproduced in any form without the prior written consent of Epicor Software Corporation.
Epicor, Vantage, and Vista are registered trademarks of Epicor Software Corporation. All other trademarks are property
of their respective owners. Microsoft product screen shots reprinted with permission from Microsoft Corporation.
Epicor Software Corporation makes no representations or warranties with respect to the contents of this document
and specifically disclaims any implied warranties of merchantability, satisfactory quality or fitness for any particular
purpose. The contents of this document are believed to be current and accurate as of its date of publication. Changes
to this document between reprintings and other important information about the software product are made or
published in release notes, and you are urged to obtain the current release notes for the software product. We welcome
user comments and reserve the right to revise this publication and/or make improvements or changes to the products
or programs described in this publication at any time without notice. The usage of any Epicor Software shall be pursuant
to an Epicor end user license agreement and the performance of any consulting services by Epicor personnel shall be
pursuant to Epicor's standard services terms and conditions.
ED837905
90521-905-9205-583600B
9.05.600
TOC | 3
Contents
Advanced Embedded Customization Course........................................................................5
Before You Begin....................................................................................................................6
Audience.........................................................................................................................................................6
Prerequisites....................................................................................................................................................6
Environment Setup..........................................................................................................................................7
Workshop Constraints..............................................................................................................................7
Customization Overview........................................................................................................9
The Script Editor Feature................................................................................................................................10
Script Editor Context Menu............................................................................................................................11
Event Handlers...............................................................................................................................................11
Workshop - Review the Script Editor..............................................................................................................14
Launch a Customization.........................................................................................................................14
Review the Default Script........................................................................................................................15
Identify Scripting Regions........................................................................................................................16
Use the Test Code Feature......................................................................................................................17
Epicor 9 | 9.05.600
Code Examples......................................................................................................................47
UI Controls and Form Events..........................................................................................................................47
Workshop - Work with Embedded Dashboards.......................................................................................48
Add a New Sheet............................................................................................................................48
Define the Publish and Subscribe Options of the Dashboard............................................................49
Modify Infragistics Components...................................................................................................................50
Modifying Sub Processes................................................................................................................................51
Workshop - Modify Sub Processes..........................................................................................................52
Identify the Sub Process...................................................................................................................52
Customize the Memo Window........................................................................................................52
Create the Sub Process....................................................................................................................53
Create the Process Calling...............................................................................................................54
Test the New Sub Process................................................................................................................54
Delete the Sub Process....................................................................................................................55
Tracing Options.....................................................................................................................56
Workshop - Create the Tracing Log................................................................................................................57
Configure and Start a Trace Log.............................................................................................................57
Create an XML Trace Report...................................................................................................................57
Disable Tracing.......................................................................................................................................58
Customization/Personalization Maintenance.....................................................................59
Workshop - Use Customization/Personalization Maintenance.........................................................................61
Export a Customization...........................................................................................................................61
Import a Customization File....................................................................................................................61
Review and Verify the Imported Customization File.................................................................................62
Conclusion.............................................................................................................................63
Epicor Software
Epicor 9 | 9.05.600
Audience
Specific audiences will benefit from this course.
System Administrator
IT/Technical Staff
Prerequisites
In order to complete the workshops in this course, all necessary modules must be licensed and operating in your training
environment. For more information on the modules available, contact your Epicor Customer Account Manager
EpicorCAM@epicor.com. It is also important that you understand the prerequisite knowledge contained in other valuable
courses.
Navigation Course - This course introduces navigational aspects of the Epicor application's user interface. Designed
for a hands-on environment, general navigation principles and techniques are available at each of the interface
levels in the Epicor application - system, module, and program. Workshops focus on each of these levels and guide
you through each navigational principle introduced.
Personalization Course - This course covers how to personalize the Epicor application by adjusting the views,
options, and toolbars to best suit your business needs. This course focuses on the personalization tools available to
all users, regardless of security privileges.
Advanced Personalization - This course shows you how to personalize your Epicor application in a way that best
suits your company's needs. It introduces the changes you can make to the layout and content that does not affect
the actual data or minimum mandatory requirements of the Epicor application. These features are specific to users
with Personalization security privileges.
Embedded Customization Course - This course covers all aspects of the customization model which is built into
the framework for Epicor 9 and beyond. Users may personalize their environment if given the authority. This course
goes beyond the personalization aspects to allow system administrators to deploy standard customizations based
on their specific business requirements. This includes adding and removing data elements, modifying component
properties, adding VBScript "code points" to run before and after data field modifications, and much more.
Database Concepts Course - This course reviews the table and field name identification process using Field Help,
Customization Tools, and the Data Dictionary Viewer functionality. It also describes table linking procedures and
requirements, Dataset Relationships Tracker features, and join type definitions and specifications.
Some of the material in this course addresses object oriented programming conventions and specifically, VB.Net
and C# programming language syntax to author code. The following can be useful as additional study materials:
A general reference or text on Object Oriented concepts.
A language reference for Visual Basic, Visual Basic .NET, or C#.
Previous coursework in .NET framework with a concentration in namespaces.
Additional information from Microsoft Developer's Network.
Epicor Software
Environment Setup
The environment setup steps and potential workshop constraints must be reviewed in order to successfully complete
the workshops in this course.
Your Epicor training environment, in which the Epicor demonstration database is found, enables you to experience
Epicor functionality in action but does not affect data in your live, production environment.
The following steps must be taken to successfully complete the workshops in this course.
1.
Verify the following or ask your system administrator to verify for you:
Your Epicor training icon (or web address if you are using Epicor Web Access) points to your Epicor
training environment with the Epicor demonstration database installed. Do not complete the course
workshops in your live, production environment.
Note It is recommended that multiple Epicor demonstration databases are installed. Contact Support
or Systems Consulting for billable assistance.
The Epicor demonstration database is at the same service pack and patch as the Epicor application.
Epicor's education team updates the Epicor demonstration database for each service pack and patch. If your
system administrator upgrades your Epicor application to a new service pack or patch, he or she must also
download the corresponding Epicor demonstration database from EPICweb > Support > Epicor > Downloads
and install it. If this is not performed, unexpected results can occur when completing the course workshops.
Your system administrator restored (refreshed) the Epicor demonstration database prior to starting
this course. The Epicor demonstration database comes standard with parts, customers, sales orders, and so
on, already defined. If the Epicor demonstration database is shared with multiple users (that is, the database
is located on a server and users access the same data, much like your live, production environment) and is not
periodically refreshed, unexpected results can occur. For example, if a course workshop requires you to ship a
sales order that came standard in the Epicor demonstration database, but a different user already completed
this workshop and the Epicor demonstration database was not restored (refreshed), then you will not be able
to ship the sales order. Epicor's education team has written the course workshops to minimize situations like
this from occurring, but Epicor cannot prevent users from manipulating the data in your installation of the
Epicor demonstration database.
2.
Log in to the training environment using the credentials manager/manager. If you are logged in to your training
environment as a different user, from the Options menu, select Change User.
3.
From the Main menu, select the company Epicor USA (EPIC03).
4.
Workshop Constraints
Below is a list of workshops in this course that can be performed only once in each instance of a restored (refreshed)
database. Where applicable, a detailed explanation of the workshop constraints is documented in the workshop itself.
Workshop - Create the Tracing Log
Epicor 9 | 9.05.600
Epicor Software
Customization Overview | 9
Customization Overview
Five layers make up the Epicor Customization model but only two are available for modification: Personalization and
Customization. These layers are considered the User Interface (UI) and modifications to these layers affect how screens
display. The difference between the two UI layers is that Personalization follows the user ID and Customization follows
the company and the module.
Customization allows you to change the UI permanently and roll it out to the entire company. Use the Business Process
Management (BPM) module to incorporate modifications to the business logic to enhance changes to the UI. This tool
allows you to create custom routines you can execute before or after the execution of business objects used in a
program.
Selecting the Tool
The Epicor application provides a number of powerful tools that assist in the customization of both the client side
interface as well as the server logic that governs the use of the business objects accessed by each form. In addition,
the modification can entail the consumption and use of information from systems outside the application. Selecting
the appropriate tool to create the customization is perhaps the most crucial step in the modification process because
the tool carries with it both a series of benefits and constraints.
In general, the appropriate tool set to select is Business Process Management (BPM) for server-side modifications
that adjust or circumvent the established order and functionality of the business objects accessed by a particular form.
Conversely, for modifications that require UI changes and the enforcement of other rules at the time of data entry or
retrieval in the UI, Embedded Customization is the best choice. Finally, when retrieving, consuming, and publishing
data from the manufacturing application to external applications, Service Connect can provide the most appropriate
solution to build the workflow necessary to accommodate data transactions of this type.
This course focuses on the embedded customization (EC) capability which applies solely to the ability to modify user
interface components. EC modifications, which save to the server, affect only the client side display and logic.
Example A common example is the need to make certain fields in the Epicor application mandatory that the
application does not require as purchased. While this modification at first might make sense using EC, remember
that the enforcement of data entry into a specific field on the UI ensures everyone is required to enter data in
the field. Any external applications (such as web services enabled forms) do not observe the client side
modification. In this case, the tool of preference is Business Process Management.
Business Process Management or Embedded Customization?
The term advanced customization is perhaps too vague in scope. It implies an extension to any type of modification
you can accomplish within the Epicor application that significantly impacts the way a business object might function.
While this course exclusively focuses on the embedded customization tool set in the application, the Business Process
Management (BPM) module allows you to create custom routines. You can execute custom routines before, after, or
at the same time as the execution of the business objects in the application. BPM employs method directives you can
author within the application using the Progress 4GL code and the BPM method directive wizard that assists you in
setting up triggers for actions. For more information and training on the BPM functionality and server-side modifications
that affect the business logic of the application, refer to the Business Process Management course.
Non-Customizable Forms
Some programs, or forms, within the Epicor application cannot be customized. This security condition is placed on
programs that contain sensitive system level functions. If customizations were made to these programs, they could
harm the performance and function of the application. For example, you cannot customize the Business Activity Query
Designer program.
Epicor 9 | 9.05.600
2.
dsData (DataSet) - This is an empty DataSet of the Foreign Key Views Type.
3.
TableName (String) - This represents the table name that corresponds to the view in the DataSet.
Epicor Software
Customization Overview | 11
Dim fkvUD01 As ForeignKeyDataView = csm.AddForeignKeyView(MyUD01View, dsData,
UD01)
NotifyForeignKeyView Method
Use this method to update a ForeignKeyView added by the AddForeignKeyView() method. This method notifies controls
bound to the ForeignKeyView that the data has changed. This method is almost always used in conjunction with
business logic adapters. Use of this method requires the same parameters as the AddForeignKeyView method. The
following lines of code demonstrate the use of this method:
'// notify with updated data
csm.NotifyForeignKeyView("UD01", CType(ud06Adapter.UD01Data, DataSet), "UD01")
Event Handlers
Event Handlers are special methods you can use to run code at particular times.
Example An event handler is called when you open and close a User Interface application, when certain events
relative to the data occurs, or when a business logic call occurs. These methods listen for events fired by objects
in the application.
In addition, event handlers are extremely common methods you can use to establish active listeners for specific events.
These objects (methods + data) are available to programs throughout the Epicor application using the custom coding
engine and are passed to custom assembly when the UI opens.
InitializeCustomCode()
This is the first method called in custom Code Initialize module level variables. It can create custom EpiDataViews and
add them to the transaction object.
Epicor 9 | 9.05.600
Epicor Software
Customization Overview | 13
This event handler does the following:
Validates the entered value.
If the value is not valid, then you can prevent the user from leaving the field until a correct value is entered.
Retrieve()
This event handler is called when you click the Retrieve button on the Standard toolbar. This button is added to the
toolbar if the EpiRetrieveToolName property is set for a panel. In the event handler code, args.ToolName is the value
that is set. Use this event handler if the data should refresh with data from the database.
[FormName]_Load() Called From End of EpiBaseForm_Load()
This is used for events that fire during the UI Form_Load() but after the InitilizeCustomCode() method runs.
[FormName]_Closing() Handles EpiBaseForm.Closing()
This event handler is used to clean up module level variables.
[ViewName]_EpiViewNotification() Handles
This event runs the EpiDataView.EpiViewNotification event. It is triggered just after a dataView is loaded into a program.
Essentially, this event signals the Epicor application to indicate data is ready for you to view and edit. It pre-populates
default values on GetNew. Examples might include unique ID generation in a UD table or default values generation.
AfterGetByID
Use this event handler to duplicate behavior. Customization Wizards do not generate code for this method.
oTrans_[AdapterName]_BeforeAdapterMethod()
This event handler runs just before an adapter runs. You can use it to validate data, check for required fields, and so
on. This method can be canceled which causes the corresponding AfterAdapterMethod call to cancel as well.
oTrans_[AdapterName]_AfterAdapterMethod()
This event handler handles the oTrans_ordAdapter.AfterAdapterMethod. It activates just after an adapter is executed
and performs the following:
Populates default values into a form.
Updates an external business object.
Runs the code just after a business layer call completes.
Event Sequences
Events execute in a specific order at start up or shutdown. When the form launches, events for the Startup Sequence
execute in the following order:
1.
InitializeCustomCode()
2.
[FormName]_Load()
When the form closes, events for the Shutdown Sequence execute in the following order:
1.
[FormName]_Closing
2.
DestroyCustomCode()
Epicor 9 | 9.05.600
Launch a Customization
Navigate to Sales Order Entry.
Menu Path: Sales Management > Order Management > General Operations > Order Entry
1. In the Select Customization window, select the Base Only check box and click OK.
This check box is a safeguard for creating new customizations. Selecting it indicates the new customization is
based on the original code requirements of the forms, excluding any personalizations. It also protects the new
customization from being deployed to a menu before it is complete.
The Sales Order Entry form displays.
2. From the Tools menu, select Customization.
3. Navigate to the Script Editor sheet and maximize the window.
4. Review the interface as described below:
All Code - Use this check box to see all the code the framework generates in a display only mode.
Program Selection - The first decision you must make is whether to use the VB.NET or the C# program. Once
you make the decision and save the customization, all other modifications must be in the same language.
Current Sheet - This sheet displays all system and custom code. All lines of code are numbered.
Test Code - This option is available under the Tools menu. Use this option to verify the code compiles
successfully.
Comments - These are lines of text that define specific sections of code but are not part of the code itself. It
is recommended to use comments to describe custom code at all times. Below is a sample of comment lines
which always display in green on the screen.
Comments in C#:
// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module
Level Variables' Comments! *
// Begin Wizard Added Module Level Variables **
// End Wizard Added Module Level Variables **
// Add Custom Module Level Variables Here **
*
Comments in VB.NET:
'// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module
Level Variables' Comments! *
Epicor Software
Customization Overview | 15
'// Begin Wizard Added Module Level Variables **
'// End Wizard Added Module Level Variables **
'// Add Custom Module Level Variables Here **
Epicor 9 | 9.05.600
SECTION 5
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
End Module
2.
3.
4. Examine SECTION 3:
Any area that begins with '// (VB.net) or // #) indicates comments. These sections display in green. They guide
custom code entry and document what the next routine is, which is helpful for other developers.
5. Examine SECTION 4:
The Sub InitializationCustomCode() indicates the beginning of code and methods for a specific routine.
6. Examine SECTION 5:
Epicor Software
Customization Overview | 17
The Sub DestroyCustomCode section is the Epicor application's way to clean up and refresh for the next routine.
All sub-routines initialize and then destroy (refresh) in preparation for the next routine or event.
2. At the bottom of the Script Editor, in the Output pane, view the test results.
You may need to maximize the window to view the results.
In this example, no custom code is entered, so the compile displays Custom Code Compiled Successfully.
3. Close the Customization Tools Dialog window.
4. Exit Sales Order Entry.
Epicor 9 | 9.05.600
ToolBox
Use the ToolBox to create custom controls on all sheets. When you select the ToolBox option from the Tools menu,
it displays on top of your current form. Click the buttons on the ToolBox to create custom controls on the form such
as text boxes, grids, check boxes, and so on.
The following toolbox elements are used in this course:
EpiLabel - This is the label associated with the grid.
EpiTextBox - This is the element that captures and stores string values.
EpiButton - This works in tandem with the Form Event wizard to set up the event handled by the button.
EpiUltraCombo - This is field that populates through hard-coded values or through values specified in a table.
EpiGroupBox - This is the visual element you can use to group screen elements.
EpiDateTimeEditor - This allows you to capture and store date/time values.
EpiPicture Box - This allows you to display images.
Epicor Software
Epicor 9 | 9.05.600
Create a PictureBox
Navigate to Part Maintenance.
Menu Path: Sales Management > Order Management > Setup > Part
1. In the Select Customization window, select the Base Only check box.
2. In the Default Customization Programming Language pane, select Visual Basic and click OK.
Note It is important to declare the programming language you want to use for the customization before
you make any changes to the form. This example uses the VB.Net programming language.
Part Maintenance displays.
3. From the Tools menu, select Customization.
The Customization Tools Dialog window displays.
4. If the Clear Confirmation message displays, click Yes.
This clears the screen of any data in preparation for customization.
5. Navigate to the Script Editor sheet.
6. Verify the VB (Visual Basic) option is selected.
7. From the Tools menu, select ToolBox.
8. In the Toolbox window, click EpiGroupBox.
9. Click inside the form, to the right of the Part field.
The Select Layer Type window displays.
10. In the Select Layer Type window, select Customization and click OK.
11. Drag the epiGroupBoxC1 down so that it fills the empty area to the right of the Part, Description, Type, and
UOM Class fields.
12. In the Customization Tools Dialog window, select the Properties sheet.
13. In the Text property, delete the content and enter Part Picture.
Epicor Software
11. In the Description field, enter XXX Part with Picture Box (where XXX are your initials).
Note Spaces are allowed when you enter a value in the description field.
Epicor 9 | 9.05.600
13. In the Add/Edit Comments box, enter Add a picture box and click OK.
The Epicor application automatically records your user name and date of the comment.
Now that handlers are established, enter custom code into the Script Editor to define the picture box file.
Author a Routine
1. Navigate to the Script Editor sheet.
Maximize the Customization Tools Dialog window.
2. Enter the first code just below '// Add Custom Module Level Variables Here ** and before the Sub
InitializeCustomCode() entry:
Dim mFileName As String
This code identifies the filename as a string.
3. Enter the following code after the Sub InitializeCustomCode() entry but before the comments:
mFileName = String.Empty
4. Enter the following code after the Sub DestroyCustomCode () area of the Script Editor and directly below the
End Sub statement.
Private Sub SetPictureBoxIconFromAttachMent()
Dim edvPartAttach As EpiDataView = CType(oTrans.EpiDataViews("AutoAttachPart") ,
EpiDataView)
If (Not(edvPartAttach Is Nothing) And (edvPartAttach.dataView.Count > 0)) Then
Dim fileName As String =edvPartAttach.dataView(0)("FileName")
If (mFileName <> mfileName) Then
mFileName = mFileName
picPartAttachment.Image = System.Drawing.Image.FromFile(mfileName)
Else
mFileName = String.Empty
picPartAttachment.Image = Nothing
End If
End Sub
Tip Make sure to enter the initial Dim statement as well as the If - Then clause into one row to avoid
syntax errors.
5. Immediately below this area, look for the event handlers added in the Form Event Wizard that begin with Private
Sub AutoAttachPart_AfterRowChange.
Just below the 'Add Event Handler Code ' line, enter:
SetPictureBoxIconFromAttachMent()
For each event handler, you need to add a method call to reference the routine you have just authored.
Epicor Software
Epicor 9 | 9.05.600
Epicor Software
Epicor 9 | 9.05.600
Epicor Software
Epicor 9 | 9.05.600
Epicor Software
Epicor 9 | 9.05.600
3. Select the PlantID object and view the corresponding code samples in the VB.Net example pane that demonstrate
how to access each property. The two examples on this screen provide code choices for the Get Property and
Set Property methods.
Epicor Software
Epicor 9 | 9.05.600
It is necessary to call out the variables indicated in the brackets. In the first line of code, a variable name must be
supplied to hold the new EpiDataView in code. Think of the EpiDataView as the entire table view for a customer.
The second line of code helps drill further down to field-level data by establishing a second variable based on the
value of the field in the EpiDataView. Bracketed text requires the substitution of a variable for the EpiDataView
value associated with the Due Date field for the job.
In general, the naming convention for EpiDataView variables is edvXXX.
Code snippets in the Object Explorer assist in writing the VB.NET subroutines necessary to complete customization
projects.
Below is an example of the InitializeCustomCodeI() method.
You can use this method to extend the object properties. The following code extends the JobNum field properties
inside the JobHead EpiDataView.
The VB.NET code is as follows:
Private Sub SetExtendedProps()
// Get EpiDataView reference
Dim edv As EpiDataView = CType(oTrans.EpiDataViews("JobHead"), EpiDataView)
If edv.dataView.Table.Columns.Contains("JobNum") Then
edv.dataView.Table.Columns("JobNum").ExtendedProperties("ReadOnly") = True
edv.dataView.Table.Columns("JobNum").ExtendedProperties("Enabled") = False
// or to make invisible
edv.dataView.Table.Columns("JobNum").ExtendedProperties("IsHidden") = False
End if
End Sub
The C# code is as follows:
private static void SetExtendedProps()
{
// Get EpiDataView reference
Dim edv As EpiDataView = CType(oTrans.EpiDataViews("JobHead"), EpiDataView)
if (edv.dataView.Table.Columns.Contains("JobNum"))
{
edv.dataView.Table.Columns["JobNum"].ExtendedProperties["ReadOnly"] = true
edv.dataView.Table.Columns["JobNum"].ExtendedProperties["Enabled"] = false
// or to make invisible...
//edv.dataView.Table.Columns["JobNum"].ExtendedProperties["IsHidden"] = false
}
}
Note The reference to make invisible in the above code demonstrates the manual way to hide a field.
There is also an Extended Properties wizard available to manipulate these properties (discussed later in the
course).
Epicor Software
Review Adapters
Data adapters are bridges between datasets and datasources. Without an adapter, a dataset cannot access any kind
of data source.
The data adapter takes care of all connection details for the dataset, populates it with data, and updates the data
source. The methods on the adapters allow you to view the data within the dataset in a variety of ways and also provide
methods for the manipulation of the data. This second line of code helps drill further down to field-level data by
establishing a second variable based on the value of the field in the EpiDataView. Bracketed text requires the substitution
of a variable.
1. In the Custom Object Explorer window, navigate to the Adapters sheet.
2. Click the Get Adapters button.
All adapters are brought in at one time the first time you select this button.
3. Expand the Adapters node.
4. Select the PartAdapter adapter.
The adapter must know what assemblies (or .dll programs) are required to find its data. These display in the
Assembly References pane.
5. Expand the PartAdapter > Classes > PartAdapter > Methods node.
The method defines how the search locates the unique value for retrieval.
6. Select the GetByID method.
The Return Type of the method, Parameters (if any), and a VB.Net Example that demonstrates how you can
use it in a script displays.
In this example, the return type is a Boolean value that takes the parameter that represents the partNum value.
The GetByID method in this case assists in writing a script where you must validate data based on the existence
of a specific part number.
Example To call a specific field from the Part master file in the Engineering Workbench and update the
data in that field through the workbench, use the GetByID to validate the part number necessary before
you access the field data to modify.
Epicor 9 | 9.05.600
Options Menu
The Tools > Options sub-menu contains an option to determine if the Customization Tools Dialog window is to
remain on top when you customize a form and an option to specify grid settings.
These options determine how the Customization Tools Dialog box is used during the current session. Some key grid
options can also be defined.
The following is a brief explanation of the choices:
Top Most - The dialog box, by default, displays on top of the form. You can clear this check box to display it behind
the form.
Grid Settings - Use the Grid Settings option to specify the grid characteristics used in Customization mode. Grid
settings include activating the Snap To Grid functionality and determining the grid size.
GridSize: Use the Grid Settings option to specify the grid characteristics used in Customization mode.
Snap To Grid: Select this option to help position shapes when you are creating customizations on a grid. When
this option is selected, the shapes pull, or snap, towards the grid dots.
Data Tools
Use Customization Tools Dialog > Tools > Data Tools to create and edit custom data views.
Use this functionality to link related tables together so they display the information you need.
Epicor Software
Epicor 9 | 9.05.600
Epicor Software
Epicor 9 | 9.05.600
Epicor Software
Epicor 9 | 9.05.600
Epicor Software
Epicor 9 | 9.05.600
Epicor Software
Use the Business Logic Method Call Wizard to add the Company adapter as an assembly and define the method
to call.
2.
Create a private function that defines the creation of the new ECO number using the method.
3.
Create the EpiNotificationEvent to tell the Epicor application to create the ECO number when the form is called.
Important This workshop assumes Developer Mode is active and you are logged in with appropriate permissions
to generate customizations.
Epicor 9 | 9.05.600
Author a Routine
Now that the adapter is added, custom code is written to complete the definition of the GetECO() as String call.
Add a private function to tell the Epicor application what must be done. In this example, the code tells the application
how to create the new ECO group number.
1. Navigate to the Script Editor sheet.
2. Locate the Private Sub CallCompanyAdapterGetByIDMethod() section and change the existing code to:
Private Function GetNextECO() As String
3. Add the following code just below the Dim result As Boolean = adapterCompany.GetByID(company)
entry:
Dim nextECO As String = String.Empty
If (result) Then
nextECO = adapterCompany.CompanyData.Company.Rows(0)("Number02").ToString()
Epicor Software
Add an EpiNotificationEvent
Trigger an EpiNotificationEvent right after a dataView loads into an application. It signals that the data is ready to view
or edit.
The code below defines the next sequential number by calling the GetNextECO routine. The following code defines
the GroupID as a two digit year followed by a dash and the next sequential number.
1. In the Customization Tools Dialog window, navigate to the Wizards > Form Event Wizard sheet.
2. In the Select Event Type field, select EpiViewNotification.
3. In the Select View/Table (and Field) Views: field, select ECOGroup.
4. Click the blue right arrow to record the selection.
See the code that displays in the View / Edit Event Handling Code pane.
5. Click the Update Selected Event Code button.
The Epicor application generates the Form Event code and places it inside the Script Editor.
6. Navigate to the Script Editor sheet and locate the Private Sub edvECOGroup_EpiViewNotification
section in the code window.
7. Enter the following code after the If (args.Row > -1) Then code line:
view.dataView(Args.Row)("GroupID") =
Right(Year(view.dataView(args.Row)("CreatedDate")),2) & "-" & GetNextECO
view.dataView(args.Row)("ECO") = view.dataView(args.Row)("GroupID")
8. From the Tools menu, select Test Code.
The ** Custom Code Compiled Successfully ** message displays.
Epicor 9 | 9.05.600
Epicor Software
Code Examples | 47
Code Examples
This section includes several workshops that present custom coding examples using all the customization tools.
Following is a list of customization techniques discussed:
UI-Controls - Each item in the embedded customization toolbox represents a user interface control.
Modify a Sub Process - A sub-process is a routine called from a variety of UI applications. You can customize them
only by calling out the specific process. A new Sub-Process menu is then created and attached to the original process,
which is called using the new customization.
Epicor 9 | 9.05.600
Epicor Software
Code Examples | 49
Tip Use the AppBuilder Panel to cause the embedded dashboard to build the finished dashboard
assembly. This selection generally provides better performance as the dashboard is loaded after it is compiled.
10. Click the Dashboard ID button to search for and select the PartOnHandStatus dashboard.
11. Select both the Display Dashboard Tool Bar and Display Dashboard Status Bar check boxes.
These selections bring in the elements directly from the dashboard.
12. Click Next to proceed to Step two of the wizard.
Epicor 9 | 9.05.600
Epicor Software
Code Examples | 51
End Sub
Epicor 9 | 9.05.600
2.
3.
4.
The following workshop demonstrates how to customize the Memo Entry sub process when called from a customer
record.
Important The workshop assumes the Developer Mode is active and you are logged in with appropriate
permissions to generate customizations.
Epicor Software
Code Examples | 53
3. In the Customization Tools Dialog window, select Tools > ToolBox.
4. In the Toolbox, select the EpiDateTimeEditor.
5. Click inside the groupbox, below the Memo Category field.
The Select Layer Type window displays.
6. In the Select Layer Type window, select Customization and click OK.
7. Draw the new field just below the Memo Category field.
8. Navigate to the Customization Tools Dialog > Properties sheet and select the EpiBinding field.
9. Open the list, expand Memo, and double-click Date01.
10. From the Toolbox, select the EpiLabel tool and create a label to the left of the EpiDateTimeEditor field.
11. Click the newly created epiLabelC1.
12. Navigate to the Customization Tools Dialog > Properties sheet and select the Text field.
13. In the Text field, delete the content and enter Create Date.
14. Click Save.
The Customization Save Dialog window displays.
15. In the Name field, enter XXXMemo (where XXX are your initials).
16. In the Description field, enter XXX Memo (where XXX are your initials) and click Save.
17. In the Customization Comment window, enter Added Create Date Field and click OK.
18. Close the ToolBox and the Customization Tools Dialog window.
19. Exit Memo Entry and Customer Maintenance and return to the Main menu.
The Memo Entry UI is now customized. The new sub process must be defined.
Data
Menu ID
Epicor 9 | 9.05.600
Field
Data
Name
XXX Memo with Create Date (where XXX are your initials)
Security ID
SEC018
Order Sequence
100
Program Type
Program
Epicor.Mfg.UI.MemoEntry.dll
Tip If you receive the Duplicate Order Sequence for this parent menu ID message, use a different
Order Sequence number.
3. In the Customization field, select XXXMEMO (where XXX are your initials).
4. Click Save and exit Sub Process Maintenance.
5. From the Main menu, select Options > Change User ID.
This refreshes the session and makes the new menu item available.
6. Log back in to the Epicor application.
In the User name and Password fields, enter manager.
Epicor Software
Code Examples | 55
In the User name and Password fields, enter manager.
Test the new sub-process.
Navigate to Customer Maintenance.
Menu Path: Sales Management > Order Management > Setup > Customer
1. In the Customer field, enter Addison and press Tab.
2. From the Actions menu, select Memo.
3. Verify the new customized version of Memo Entry includes the Create Date field.
4. Exit both Memo Entry and Customer Maintenance.
Epicor 9 | 9.05.600
Tracing Options
The Tracing Options Form window allows you to set up a tracing log that captures all the calls the user interface
makes to the server. When you activate this log, any business logic (BL) calls sent to the server are automatically
recorded within this log.
The tracing log tool has several uses. Web service developers can use this log to see what business logic calls are being
made when users launch a specific function, for example, the BL calls made when a user enters a new customer record.
Custom programmers can use this log to fine-tune their customized applications. Epicor Support may also ask you to
turn on this log to help them track issues.
To make this log easier to review, you can enter Mark Text to organize it; all calls that reference this mark text are
then grouped together. You have the option to display this log either as a text ( .txt) file or as an .xml file. Note that
a pre-built .xml style sheet is included with this functionality. It is recommended that you use the .xml file format, as
it organizes these calls in a readable format.
Note You can also turn the tracing log on and off within the mfgsys.exe.config file.
Epicor Software
Tracing Options | 57
Epicor 9 | 9.05.600
Disable Tracing
Disabling the Tracing functionality is important when it is not necessary to run. The Tracing Log can become
overwhelmingly large if it is always enabled.
1. In the Tracing Options Form window, clear the Enable Trace Logging check box.
2. Click the Apply button.
3. Click OK.
The Tracing Log is now disabled.
Epicor Software
Customization/Personalization Maintenance | 59
Customization/Personalization Maintenance
Customization/Personalization Maintenance is an important tool that allows you to manage all the customizations
and personalizations that exist within your Epicor application. Its primary feature is its verification functionality that
allows you to detect problems within any customization or personalization.
Menu Path: System Management > Utilities > Customization Maintenance
Important This program is not available in the Epicor Web Access interface. You can launch this program
Epicor 9 | 9.05.600
Epicor Software
Customization/Personalization Maintenance | 61
Export a Customization
Navigate to Customization/Personalization Maintenance.
Menu Path: System Management > Utilities > Customization Maintenance
Important This program is not available
in the Epicor Web Access interface. You can launch this program
Epicor 9 | 9.05.600
3. Note the Valid For field populates with the current application version and the Status field displays Pass.
4. Navigate to the Compile/Script Errors sheet.
If any compile errors exist, they display in the Errors grid.
5. Navigate to the Warnings sheet.
The Warnings sheet displays errors (if they occur) that indicate a problem with the customization. The code must
compile before an accurate list of warnings displays.
6. In the tree view, verify your customization MyBLWizardXXX (where XXX are your initials) is selected.
7. On the Standard toolbar, click Delete.
8. To the Delete this record? message, click Yes.
9. Exit Customization/Personalization Maintenance.
Epicor Software
Conclusion | 63
Conclusion
Congratulations! You have completed the Advanced Embedded Customization course.
Please take a moment to let Epicor know how to serve you better by completing a course evaluation at
http://www.keysurvey.com/survey/191084/2e21/ or by clicking the Course Evaluation link below. Your feedback provides
the guidelines for the future direction of Epicor education.
Epicor 9 | 9.05.600