I am trying to obtain the the next AP payment number using C# and eConnect. This code looks straightforward enough however it does not recognize
GetNextDocNumbers nor the reference to using Microsoft.GreatPlains.eConnect.MiscRoutines;
I have added the
Microsoft.Dynamics.eConnect and
Microsoft.Dynamics.eConnect
.Serialization to the project.
What must I do to be able to obtain the next AP payment number using eConnect and C#?
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.GreatPlains.eConnect.MiscRoutines;
namespace MiscRoutinesConsole
{
class ClassMiscRoutines
{
static void Main(string[] args)
{
try
{
string cnString = @"Data Source=MYSERVER;initial catalog=TWO;integrated security=SSPI;
persist security info=False;packet size=4096";
GetNextDocNumbers oNextDoc = new GetNextDocNumbers();
string nextPMPaymentNumber = "";
nextPMPaymentNumber = oNextDoc.GetNextPMPaymentNumber(GetNextDocNumbers.IncrementDecrement.Increment, cnString);
Console.WriteLine("The next PM Payment Number is " + nextPMPaymentNumber);
Console.WriteLine("Press <Enter> to close...");
Console.Read();
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
Console.WriteLine("Press <Enter> to close...");
Console.Read();
}
}
}
}