Epicor functions

My company currently uses Epicor 10 for their business. As a software developer I am writing a C# Windows application and want to use some of the data pieces that the company stores in their Epicor. What references do I need to add to my project, as well as “using statements”, and code in C# in order to access certain database fields and such? Are there any examples? I am really not sure what I am going to access specifically yet but am trying to research how and what I will need to have in my code to do so.

I would recommend being “loosely coupled” and not use references. It will make your upgrades so much easier. I would recommend @josecgomez and @jgiese.wci’s REST helper:

2 Likes

You should be using the REST interface. There’s a TON of data about that in this forum erm… ok @Mark_Wonsil beat me to it,
#WhatHeSaid

3 Likes

I am testing the water and have started out with this but am getting the error listed below. Pardon my inexperience. I never heard of Epicor 30 days ago but want to use my windows desktop app to access data. The code in Epicor is the following and I want to do something similar.

var ud16 = WCFServiceSupport.CreateImpl((Session)oTrans.Session, ImplBase<Ice.Contracts.UD16SvcContract>.UriPath);
bool outBool;
var wc = string.Format(“Key1 = ‘{0}’ AND Key2 = ‘{1}’ AND Number01 <= {2} AND Number02 >= {2}”, AdderType, ID, Qty);
var ud16DS = ud16.GetRows(wc, “”, 0, 0, out outBool);

Here is what I am trying to do…

CallContextHeader callContext = new CallContextHeader();
Dictionary<string, string> dictionary = new Dictionary<string, string>();

        dictionary.Add("$filter", "$Key1 eq 'PASSES' and Key2 eq '1-3' and Number01 <= 101 and Number02 >= 101");

        EpicorRestStatusCode statusCode = new EpicorRestStatusCode();
        EpicorRest.DynamicGet("Ice.Contracts.UD16SvcContract", "UD16Impl", dictionary, statusCode, callContext);

and I get this error…

Could not load file or assembly ‘Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed’ or one of its dependencies. The located assembly’s manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

You need to install NewtonSoft (using nuget would help here)

Note it wants version 11… make sure you download / install the right version.

The error says 11.0.0 but what I find is 11.0.1. Will this work?

Yes it should.

I am trying to accomplish this through my C# windows application code.

Epicor code
var ud16 = WCFServiceSupport.CreateImpl((Session)oTrans.Session, ImplBase<Ice.Contracts.UD16SvcContract>.UriPath);

My code under a windows application button
EpicorRest.AppPoolHost = “EDBDCLEX03.F8BF-4A24”;
EpicorRest.AppPoolInstance = “Epicor10”;
EpicorRest.UserName = “jbailie”;
EpicorRest.Password = “JB_2020xcv”;
EpicorRest.IgnoreCertErrors = true;
EpicorRest.License = EpicorLicenseType.WebService;
EpicorRest.CallSettings = new CallSettings(“EDBUSA”, string.Empty, string.Empty, string.Empty);

        CallContextHeader callContext = new CallContextHeader();
        Dictionary<string, string> dictionary = new Dictionary<string, string>();

        dictionary.Add("$filter", "$Key1 eq 'PASSES' and Key2 eq '1-3' and Number01 <= 101 and Number02 >= 101");
        dictionary.Add("$top", "1");

        EpicorRestStatusCode statusCode = new EpicorRestStatusCode();
        
        dynamic newObj = EpicorRest.DynamicGet("Ice.Contracts.UD16SvcContract", "UD16Impl", dictionary, null, callContext);

I am getting a NullReferenceException and Object reference not set to an instance of an object.
when I try to execute the DynamicGet. Any ideas for this newbie?