Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Does the eConnectMethods() class still exit?

Posted on by 75,730

I was just sent some code that inserts an xml file via eConnect. It uses a class called eConnectMethods(). My current reference for eConnect does not recognize the eConnectMethods class. Has its use been discontinued? What is its replacement?

            foreach (var fi in aryFi)
            {
                strArchiveFolder = My.MySettingsProperty.Settings.Archive;
                strFileName = fi.FullName;
                strFileNameNoExt = Path.GetFileNameWithoutExtension(strFileName);
                streConnectException = My.MySettingsProperty.Settings.ErrorLog + strFileNameNoExt + "_Error.txt";
                using (var eConCall = new eConnectMethods())
                {
                    try
                    {
                        var xmldoc = new System.Xml.XmlDocument();
                        xmldoc.Load(strFileName);
                        SOPDocument = xmldoc.OuterXml;
                        string ConnectionStringGP = My.MySettingsProperty.Settings.Server;
                        1234567890abcdefghijklmnopqrstuvw = eConCall.CreateTransactionEntity(ConnectionStringGP, SOPDocument);
                        if (File.Exists(strArchiveFolder + fi.Name))
                        {
                            File.Delete(strArchiveFolder + fi.Name);
                            File.Move(fi.FullName, strArchiveFolder + fi.Name);
                        }
                        else
                        {
                            File.Move(fi.FullName, strArchiveFolder + fi.Name);
                        }
                    }

                    catch (eConnectException exp)
                    {
                        Console.Write(exp.ToString);
                        var SW = new StreamWriter(streConnectException);
                        SW.WriteLine(exp.ToString);
                        if (File.Exists(My.MySettingsProperty.Settings.Hold + fi.Name))
                        {
                            File.Delete(My.MySettingsProperty.Settings.Hold + fi.Name);
                            File.Move(fi.FullName, My.MySettingsProperty.Settings.Hold + fi.Name);
                        }
                        else
                        {
                            File.Move(fi.FullName, My.MySettingsProperty.Settings.Hold + fi.Name);
                        }
                        SW.Close();
                    }
                }
                File.Delete(fi.FullName);
            }

Categories:
  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Does the eConnectMethods() class still exit?

    Derek, this code was sent to me as a Visual Basic application. I used a C# extension to convert it to C#. I needed to add

    using Microsoft.Dynamics.GP.eConnect;
    using Microsoft.Dynamics.GP.eConnect.Serialization;

    Can you tell me what this line is doing?

    1234567890abcdefghijklmnopqrstuvw = eConCall.CreateTransactionEntity(ConnectionStringGP, SOPDocument);

    In the original code it is a string of letters and special character. It looks like the reseller license key.

  • Suggested answer
    RE: Does the eConnectMethods() class still exit?

    No changes to eConnect that I'm aware or have heard. Actually more the opposite that we're not making changes to eConnect nor Integration Manager, such as adding new features/functionality that have been added to the Dynamics GP application.

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans