Use Visual Studio or VS Code as an editor instead of Epicor Functions Maintenance

Is it possible to use another editor instead of the one provided to write Epicor functions? It would be nice to have code completion and version control to speed things up and be organized. If I knew how to find the assemblies the stock editor was using I could at least copy the code back when I was ready to run the functions. I found the Epicor Customization Editor for Visual Studio by @josecgomez it looks cool but from what I can tell it is something different from what I am describing. Any ideas?

1 Like

Yes. Give me a sec.

1 Like
//References from Server  
//Request these from BO EcfTools.GetAssemblyBytes
//Add .dll on at the local side
Epicor.System
Epicor.Ice
Epicor.Customization
Ice.Data.Model
Epicor.Functions.Core
Ice.Lib.Shared
Ice.Lib.Blaq
Erp.Data.910100
//Standard Usings
using Epicor.Customization.Bpm;
using Epicor.Data;
using Epicor.Hosting;
using Epicor.Utilities;
using Erp;
using Erp.Tables;
using Ice;
using Ice.Contracts;
using Ice.ExtendedData;
using Ice.Tables;
using Ice.Tablesets;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Linq.Expressions;

There are a few local dlls to add, but I’ll have to go dig in my notes and projects first.

If I have time I’ll set up a project harness.

There was a little more to it after looking at my notes.

Here are some notes, and a project harness.
I cannot provide the dlls for you, you will have to obtain them yourself.

This is Quick & Dirty (May not be 100%), if you want to start referencing other functions and stuff, we’ll
all have to figure that out.

The only code in this project that is mine, is the BS function code below in the
Run() procedure. This harness was built by dumping the source of a function
in a new library with a new function, built specifically to do this.

I traced, and debugged to get the references.

In this harness I provided, your function resides in the file ProjectHarness.cs

Everything you code must be in this single procedure:
(Unless you are very crafty… I’ll show that one day…)

        //This is the ONLY place you can do any work... 
        protected override void Run()
        {
              if(1 == 1)
              {
                  string hw = "Hello";
                  hw = $"{hw} World!";
              }
        }

Input/Output Arguments are referenced from ProjectHarness.args.cs

namespace EFx.ProjectHarness.Implementation
{
    public sealed class ProjectHarnessInput : Epicor.Functions.FunctionInput
    {
        public System.String input1 { get; set; }
        public System.String input2 { get; set; }
    }

    public sealed class ProjectHarnessOutput : Epicor.Functions.FunctionOutput
    {
        public System.String output1 { get; set; }
        public System.String output2 { get; set; }
    }
}

References in the .csproj file:

  <ItemGroup>
    <Reference Include=".\References\Epicor.Customization.dll"/>
    <Reference Include=".\References\Epicor.Functions.Core.dll"/>
    <Reference Include=".\References\Epicor.Ice.dll"/>
    <Reference Include=".\References\Epicor.System.dll"/>
    <Reference Include=".\References\Erp.Data.910100.dll"/>
    <Reference Include=".\References\Ice.Data.Model.dll"/>
    <Reference Include=".\References\Ice.Lib.Blaq.dll"/>
    <Reference Include=".\References\Ice.Lib.Shared.dll"/>
    <Reference Include=".\References\Epicor.ServiceModel.dll"/>
    <Reference Include=".\References\EntityFramework.dll"/>
    <Reference Include=".\References\Ice.Contracts.BO.BpHolds.dll"/>
  </ItemGroup>

There is a file in the References folder called PutTheseFilesHere.txt
It’s content:

EntityFramework.dll
Epicor.Customization.dll
Epicor.Functions.Core.dll
Epicor.Ice.dll
Epicor.ServiceModel.dll
Epicor.System.dll
Erp.Data.910100.dll
Ice.Contracts.BO.BpHolds.dll
Ice.Data.Model.dll
Ice.Lib.Blaq.dll
Ice.Lib.Shared.dll

The Harness: ProjectHarness.zip (7.2 KB)

Built with Visual Studio Code.

4 Likes

What @klincecum has provided looks good.

There is already code completiton within the Epicor editors as well (BPMs, Functions). Simply press Ctrl + Space to activate. If you do it with no text at all it doesn’t do anything, but type at least the first letter and then you’ll get everything displayed.

1 Like

Might as well ping @Mark_Wonsil so he can plug his favorite Epicor Idea…

Edit → Uhhh This post is not linked to that particular Epicor Idea thread, I think @josecgomez has some kind of global tag on it :rofl:

Interested George Clooney GIF

Uhhh This post is not linked to that particular Epicor Idea thread, I think @josecgomez has some kind of global tag on it :rofl:

He’s just trying to keep the image contained.

Yup every time the words “Epicor Idea” are shown it auto-tags to let you know that

  1. yes we know
  2. yes we know
  3. no we don’t need to know

#NotSorry

This Idea.

2 Likes

Thanks for the info. It may take me a bit to unpack all of this thread.

1 Like