Tuesday, March 29, 2011

What is DMT?



DMT stands for Data Management Tool.

Basically, it is a tool which allows the import of information into Epicor in the form of a text file.

We really only use DMT when first setting up a new Epicor implementation. The thing about DMT is, it is limited.

For some tables, you still must populate the data manually, or write custom code to populate it for you.

Here are some of the tables we populate using C# and .dll files in the Epicor Software/Client folder:
SalesRep, SalesTerritory, RefCategory, AnalysisCode

In you project, add references to:


  • Epicor.Mfg.Common.BOExceptions
  • Epicor.Mfg.Core.BLConnectionPool
  • Epicor.MFG.Core.CallContext
  • Epicor.Mfg.UI.EpiClientLib
  • Epicor.Mfg.Lib.ISessionMod
  • Epicor.Mfg.Lib.SessionMod


And then, for the business objects you want to use, add two references like this:

  • Epicor.Mfg.BO.(business object name)
  • Epcior.Mfg.IF.I(business object name)


Here is some sample code on how you can connect directly to Epicor:

public BOFactory(string company)
{
this.company = company;
string user = "manager";
string password = "manager";

m_cnVantage = new BLConnectionPool(user, password, "AppServerDC://"
+ ConfigurationSettings.AppSettings[m_strKeyVantageServer] + ":"
+ ConfigurationSettings.AppSettings[m_strKeyVantagePort]);
}

public Epicor.Mfg.BO.SalesTer GetSalesTerBO()
{
Epicor.Mfg.BO.SalesTer saleTer = new Epicor.Mfg.BO.SalesTer(m_cnVantage);
return saleTer;
}


And then, once you have your business object:

dataSet = new SalesTerDataSet();
salesTer.GetNewSalesTer(dataSet);
...
salesTer.Update(dataSet);


Also note that you can change the company you working with using this code:

public void SetCompany(string company)
{
this.company = company;
Epicor.Mfg.Lib.SessionMod sessionMod = new Epicor.Mfg.Lib.SessionMod(m_cnVantage);

sessionMod.SetCompany(company,
out companyName, out plantID, out plantName, out workstationID, out workstationDescription,
out employeeID, out countryGroupCode, out countryCode);
}

Thursday, March 17, 2011

Epicor Multi-Company Madness

Now, while I don't consider myself a genius, I feel reasonably intelligent enough to be able to accurately follow a setup installation guide.

However, when installation guide requires that you perform an action on page 75 to successfully get something on page 42 to work, something is seriously wrong.

Specifically, in Epicor's TechRefGuide_MultSite_905602.pdf, it asks you to "Test the Communication" by creating a new customer, marking them Global, save, and then:

"The Multi-Company Process transmits Customer and ShipTo records from that company and sends it to the other companies."

No, it doesn't. Skip to page 75, section "Link Global Records".

What the previous section should have said was:
1. Create the customer, mark as global, save.
2. Goto External Company Maintenance, and choose the child company, and choose Action -> Initialize Multi-Company...
3. Switch to child company, open Customer Maintenance, and choose Action, Link Customer...
4. Search for the customer you created in step once, and click Link.

Hopefully I have saved you the 2 days I wasted troubleshooting this issue.

Friday, June 25, 2010

Business Activity Query Designer

Business Activity Query Designer is availabe in Epicor under:
System Management > Utilities

It is used to create queries in Progress ADL, which can be used is dashboards, or to export data using Business Activity Query Export Process (located in same path). Business Activity Query Export Process can export a file in .csv or .xml, either as a one time process, or on a schedule.

Unfortunately, as a data export tool, ADL lacks many functions in SQL. For instance, I wanted to return only distinct rows from a table, but there is no equivalent of "SELECT DISTINCT".

Monday, April 5, 2010

Epicor 9 Printing and Print Preview

Why is my report not printing?

When you attempt to print or preview a report, Epicor 9 submits the request back to the server. The server handles the creation of the report, and asynchronoously sends it back to the client.

If the server can not generate the report, the most common reason being no matching records, it generates and error, and does not inform the client why.

If it seems like your print, or print preview is taking too long, you have to use the Epicor System Monitor taskbar application to find out why. In the bottom right of your Windows Star Bar, click in the Epicor icon. You'll find you report request under eith Active Tasks (if in progress), or History Tasks is it has already failed.

Once you've selected the task for the List tab, click the Details tab to see the error reason:


Type:3
Program:om/sopicklistreport.p
Method:Main-Block
Table:
Field:
Rowid:
Message:No Records Selected.

Epicor 9 Fulfillment Workbench

The Epicor 9 Fulfillment Workbench option is only available if you have licensed the Advanced Materials management module. It allows a finer grain of control when fulfilling orders (whether sales, build-to-order, plant transfer, etc).

One of the most confusing things is the difference beween allocating and reserving. Both options associate a part and quanity with a given order, and make that quantity unavailable to other orders. Both can be undone, making the quantity available again.

The difference between reserving and allocating is the granularity of control. When you reserver a part for an order, you can reserve that part across all warehouses, or just the primary warehouse. When you allocate a part, you can allocate a part from a specific bin or lot, or even by serial number.

Wednesday, March 24, 2010

Epicor 9 Tracing Introduction

Epcior 9 has a debugging feature called Tracing. Because Epicor 9 is based on on a DNA archictecture (distributed internet archictecture), all requests from the Epicor client are first translated into an XML document, and the submitted to the business layer through a web service call. See Introduction to Microsoft DNA for a good explanation of this architecture.

To turn on tracing, in Epcior client, to to Options, Tracing Options...

As a developer, you can see exactly what is being sent. The trace example below was generated when saving an address change for a user:


<tracePacket>
<businessObject>Epicor.Mfg.BO.UserFile</businessObject>
<methodName>Update</methodName>
<returnType>void</returnType>
...
<parameters>
<parameter name='ds' type='Epicor.Mfg.BO.UserFileDataSet' ><UserFileDataSet xmlns="http://www.epicor.com/Mfg/100/BO.UserFile/UserFile">
<UserFile>
<XUserID>neilc</XUserID>
<Name>Neil</Name>
<Address1>123 Raccoon Holow</Address1>
...
</UserFile>
<UserComp>
...
</UserComp>
</UserFileDataSet></parameter>
</parameters>
<paramDataSetChanges>
<paramDataSet name='ds' useDataSetNbr='0' >
<changedValue tableName='UserFile' rowState='Modified' rowNum='0' colName='Address1' ><![CDATA[123 Raccoon Hollow]]></changedValue>
...
</paramDataSet>
</paramDataSetChanges>
</tracePacket>

Because of the common naming convention across Epicor's namespace, I can infer from the Epicor.Mfg.BO.UserFile business object with method Update, that the following things exist:
* a table in the database called "UserFile", whose non-logic fields match parameters in UserFileDataSet
* a web service called UserFileService, with method Update

Tuesday, March 23, 2010

Epicor 9 Development

As a developer new to Epicor 9, I was dismayed at the lack of 3rd party books, online, tutorials, and documentation. This blog, hopefully, will help other Epicor 9 newbies get up to speed more quickly.

My fellow co-workers have supported the ERP in all its forms (Avante,Vantage 8, and now Epicor 9) for many years, and happy zip around the menus. I, on the other hand, struggle with the most basic of tasks.

For example:

When setting up a new user in training database of Epicor 9, I went to:
1. Epicor USA
2. Main Plant
3. System Management
4. Company Maintaenance
5. and finally User to open up the User Account Mainteneance screen.

I entered some details, unchecked Disable Account, and attempted to save.
I got the error message "Cannot enable a user if the user does not have a company assigned.".

Okay, no problem, I'll assign a company!
When to the company tab, go to select a company from the dropdown list, but, uh-oh, it's empty! Clicking the dropdrown arrow does nothing.

At this point, I must swallow my pride, and ask a co-worker for help. Turns out, you have to tell Epicor you want to add a new company, before you are allowed to select a company.

To assign a new company:
1. Once you get the error message, you must "Undo" button in teh toolbar to undo the unchecking of the disable account checkbox.
2. Click the dropdown arrow next to the ubiquitous "New" icon in the toolbar, and select New Company...
3. Then the Company dropdown is populated, and lets you choose a company.
4. Uncheck disable account.
5. Save.

Apparently, this same methodology applied to anytime you are created one to many records in the system (adding companies to a user, line items to an order, etc.)