Skip to content

Instantly share code, notes, and snippets.

@hasokeric
hasokeric / Epicor KeyField
Created March 23, 2015 18:57
Epicor KeyField Tab or Enter Action
/**
* Add Support for the KeyField to trigger something
* when the keyboard is triggered. (Does not come out of the box)
*
* @type Custom Function
* @return void
*/
private void txtKeyField_KeyDown(object sender, System.Windows.Forms.KeyEventArgs args)
{
@hasokeric
hasokeric / Epicor EpiConsole Debugging
Created March 23, 2015 18:58
EpiConsole shows a Command Prompt Window for Debugging purposes
internal static class EpiConsole
{
public static void Start()
{
IntPtr hw = GetConsoleWindow();
if (hw == IntPtr.Zero) AllocConsole();
Console.Clear();
ShowWindow(hw, 8);
Debug.Listeners.Clear();
TextWriterTraceListener writer = new TextWriterTraceListener(System.Console.Out);
@hasokeric
hasokeric / Epicor Check Negative Inventory
Created March 23, 2015 19:00
Epicor oTrans.adapter.NegativeInventoryTest
/**
* Check for Negative Inventory, Epicor does Check for this however we have no control
* wether we should play the ERROR sound or not unless we check and play the sound
* before Epicor makes a Dialog Box appear
*
* @var partNum
* @var lotNum
* @var qty
* @type Custom Function
* @return bool
@hasokeric
hasokeric / Epicor Helpers
Created March 23, 2015 19:02
Epicor Helpers
// ---------------------------------------------------------------------------------------
// HELPER FUNCTIONS
// ---------------------------------------------------------------------------------------
/**
* Rounds & Converts a value
*
* @type Custom Function
* @return decimal
@hasokeric
hasokeric / Epicor-UD-KeyField.cs
Created September 29, 2015 18:04
Epicor UD Entry KeyField
// **************************************************
// Custom code for UD100Form
// Created: 2/11/2014 10:24:37 AM
// **************************************************
using System;
using System.Drawing;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Windows.Forms;
@hasokeric
hasokeric / CleanUD01Form.cs
Created August 31, 2016 15:26
UD01 Hide tree and menu.
// Hides the tree and the menu bar.
// Leaves you with a nice blank slate.
private void UD01Form_Load(object sender, EventArgs args) {
// Hide tree view
EpiTreeViewPanel tvp = (EpiTreeViewPanel)csm.GetNativeControlReference("ff47e708-60d7-4586-9708-91a5d57fb7a6");
tvp.Parent.Parent.Visible = false;
// Hide tool bars
//Get a Handle on the Main Tool Manager for the Form
@hasokeric
hasokeric / cs.cs
Created August 31, 2016 15:29
Call SSRS Report from Code and Get the File Back
var baqR = WCFServiceSupport.CreateImpl<Ice.Proxy.Rpt.BAQReportImpl>((Session)oTrans.Session, Epicor.ServiceModel.Channels.ImplBase<Ice.Contracts.BAQReportSvcContract>.UriPath);
var dynamicReport = WCFServiceSupport.CreateImpl<Ice.Proxy.BO.DynamicReportImpl>((Session)oTrans.Session, Epicor.ServiceModel.Channels.ImplBase<Ice.Contracts.DynamicReportSvcContract>.UriPath);
var rptMonitor = WCFServiceSupport.CreateImpl<Ice.Proxy.BO.ReportMonitorImpl>((Session)oTrans.Session, Epicor.ServiceModel.Channels.ImplBase<Ice.Contracts.ReportMonitorSvcContract>.UriPath);
var rptDs = dynamicReport.GetByID("EDI870EXPORT");
var baqRptDS = baqR.GetNewBAQReportParam("EDI870EXPORT");
baqRptDS.BAQReportParam[0].Option01 = guid.ToString();
baqRptDS.BAQReportParam[0].AutoAction="SSRSGenerate";
baqRptDS.BAQReportParam[0].SSRSRenderFormat = "CSV";
baqRptDS.BAQReportParam[0].Character01=guid.ToString();
baqRptDS.BAQReportParam[0].Character02=flag;
private void btnPrntDetail_Click(object sender, System.EventArgs args)
{
if (edvEnd.Row > -1)
{
// Set status
oTrans.PushStatusText("Production Detail Report Submitting..",true);
// Create report object
Session otSession = (Session)oTrans.Session;
JobProdDtl jobproddtl = new JobProdDtl(otSession.ConnectionPool);
@hasokeric
hasokeric / cs.cs
Created September 18, 2016 00:22
Create Epicor BO Instace WCF
/*
Get an Epicor Client from WCF
Required Dll:
Epicor.ServiceModel
Erp.Contract.BO.Customer (or whatever BO you need)
System.ServiceModel
Usage:
@strepicor
strepicor / Customization.epicor
Last active April 2, 2024 02:23
Epicor Customization - Update fields using an adaptor
JobEntryAdapter adapterJobEntry = new JobEntryAdapter(this.oTrans);
adapterJobEntry.BOConnect();
DataSet dsJobDetails = adapterJobEntry.GetData(jobNum);
DataRow dr = adapterJobEntry.JobEntryData.JobHead.Rows[0];
dr.BeginEdit();
dr["FieldName_c"] = newValue;