Showing posts with label epicor. Show all posts
Showing posts with label epicor. Show all posts
Saturday, January 14, 2012
BL Tester Utility
I can't believe I didn't know about this before now.
On the Epicor Server, in the folder Epicor905/Utility are the setup files for an application called BL Tester (presumably short for Business Logic Tester).
The first time you run BL Tester, you will have to specify the Epicor server your are connecting to.
Once it is installed, click File, Open, and choose the dll for the business object you want to test.
Ie. Epicor.MFG.BO.SalesOrder.dll
You can then use the application to specify the parameters and call any business object method. For instance, you could call SalesOrder.GetRows, and specify different where conditions. After clicking "Invoke" button, BL Tester will display the result of the method, usually a dataset, in a tree view control.
Labels:
BL Tester,
business logic,
epicor,
Epicor.Mfg.BO
Friday, December 23, 2011
Workflow Locked
Recently, I had Workflow Designer crash on me, and when I tried to re-open the workflow, I got this error message:
Workflow Designer
The process is locked can cannot be saved under the same name. Open the process?
Because my session crashed, the lock was not released. I couldn't find a proper way to release the lock, but the following procedure worked for me to unlock the workflow. Use at your own risk!
On the Service Connect server, I stopped and restarted this service:
ScaLockSrv - Allows users to work simultaneously with shared data.
Labels:
epicor,
release lock,
ScaLockSrv,
Service Connect,
The process is locked,
unlock,
Workflow
Tuesday, September 27, 2011
Set ReportParam in Epicor Customization
In Epicor, I needed to customize the Sales Order Pick List report screen so it defaults to a wider From and To Ship By date range. In customization, this means updating the ReportParam value when the form loads:
Normally, to access the text field for a control in a customization you use csm.GetNativeControlReference. But, in this case, I needed to change the ReportParam, which is accessed through oTrans.EpiDataViews["ReportParam"] dataset.
private void SOPickListForm_Load(object sender, EventArgs args)
{
// wrong approach, change data source of control
// EpiTokenDate tdtFrom = (EpiTokenDate) csm.GetNativeControlReference("1f043839-c70e-41e0-8d1b-c33fd3d7e3c5");
// change from date
EpiDataView epiDataView = (EpiDataView) oTrans.EpiDataViews["ReportParam"];
epiDataView.dataView[epiDataView.Row]["FromDate"] = DateTime.Now.AddMonths(-6);
}
Normally, to access the text field for a control in a customization you use csm.GetNativeControlReference. But, in this case, I needed to change the ReportParam, which is accessed through oTrans.EpiDataViews["ReportParam"] dataset.
Labels:
customization,
epicor,
GetNativeControlReference,
ReportParam
Friday, September 23, 2011
Get Results of Epicor BAQ as DataSet in C#
One of the easiest, and fastest ways to get data out of Epicor is to use C# and the Epicor client library assemblies. This article provides sample code to export the results of a business activity query created using the BAQ Designer into a C# .Net framework dataset.
Step 1 - Add References
In you project, at a minimum you will need to reference the following assemblies:
DynamicQuery is the business object to manage BAQs (it replaces QueryDesignDataSet in Vantage). BLConnectionPool & SessionMod are necessary to explicitly set the company for the session. This is important, because otherwise the company will be whatever company was last selected for the user account used to create the session, which can yield unpredictable results.
Step 2 - Add class to create business object
The following is my class to create Epicor business objects for me:
Step 3 - Add the call to your dynamic query
Above, I'm passing in an order number as the constant value to a criteria that already exists on the OrderHed table in the design of the query.
Step 1 - Add References
In you project, at a minimum you will need to reference the following assemblies:
-Epicor.Mfg.BO.DynamicQuery
-Epicor.Mfg.IF.IDynamicQuery
-Epicor.Mfg.Core.BLConnectionPool
-Epicor.Mfg.Lib.ISessionMod
-Epicor.Mfg.Lib.SessionMod
DynamicQuery is the business object to manage BAQs (it replaces QueryDesignDataSet in Vantage). BLConnectionPool & SessionMod are necessary to explicitly set the company for the session. This is important, because otherwise the company will be whatever company was last selected for the user account used to create the session, which can yield unpredictable results.
Step 2 - Add class to create business object
The following is my class to create Epicor business objects for me:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using Epicor.Mfg.Core;
using Epicor.Mfg.Proxy;
using Epicor.Mfg.BO;
using Epicor.Mfg.Lib;
namespace ExecuteDynamicQuery
{
public class BOFactory
{
private BLConnectionPool m_cnVantage = null;
private static string m_strKeyVantageServer = "VantageServer";
private static string m_strKeyVantagePort = "VantagePort";
private string company;
private string companyName;
private string plantID;
private string plantName;
private string workstationID;
private string workstationDescription;
private string employeeID;
private string countryGroupCode;
private string countryCode;
public BOFactory(string company)
{
this.company = company;
string user = ConfigurationSettings.AppSettings["UserName"];
string password = ConfigurationSettings.AppSettings["Password"];
m_cnVantage = new BLConnectionPool(user, password, "AppServerDC://"
+ ConfigurationSettings.AppSettings[m_strKeyVantageServer] + ":"
+ ConfigurationSettings.AppSettings[m_strKeyVantagePort]);
SetCompany(company);
}
///
/// Returns the DyanmicQuery object which manages BAQs
///
///
public Epicor.Mfg.BO.DynamicQuery GetDynamicQueryBO()
{
return new Epicor.Mfg.BO.DynamicQuery(m_cnVantage);
}
///
/// returns the session mod
///
///
public Epicor.Mfg.Lib.SessionMod GetSessionMod()
{
SessionMod sessionMod = new SessionMod(m_cnVantage);
return sessionMod;
}
///
/// changes the company associated with the current session
///
///
public void SetCompany(string company)
{
this.company = company;
Epicor.Mfg.Lib.SessionMod sessionMod = GetSessionMod();
sessionMod.SetCompany(company,
out companyName, out plantID, out plantName, out workstationID, out workstationDescription,
out employeeID, out countryGroupCode, out countryCode);
}
}
} Step 3 - Add the call to your dynamic query
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
namespace ExecuteDynamicQuery
{
class Program
{
static void Main(string[] args)
{
string company = "12";
string queryID = "12-MyQuery";
string orderNum = "726250";
BOFactory factory = new BOFactory(company);
var dynamicQuery = factory.GetDynamicQueryBO();
// get query
var queryDesignDataSet = dynamicQuery.GetByID(queryID);
// get only specific order
// QueryWhereItem is a criteria on OrderHed table
queryDesignDataSet.QueryWhereItem[0]["RValue"] = orderNum;
// execute query
DataSet ds = dynamicQuery.Execute(queryDesignDataSet);
// print results
for (int i = 0; i < ds.Tables[0].Columns.Count; i++ )
{
Console.Write(ds.Tables[0].Rows[0][i].ToString());
}
}
}
}
Above, I'm passing in an order number as the constant value to a criteria that already exists on the OrderHed table in the design of the query.
Subscribe to:
Posts (Atom)