web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Using C# and eConnect to get next AP payment number.

(0) ShareShare
ReportReport
Posted on by 75,848 Moderator

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(); } } } }
Categories:
I have the same question (0)
  • Suggested answer
    sandipdjadhav Profile Picture
    18,306 on at

    Hello Richard,

    I don't think you required 'GetNextDocNumbers.IncrementDecrement.Increment'

    Your code should look like below

    nextPMPaymentNumber = oNextDoc.GetNextPMPaymentNumber(IncrementDecrement.Increment, cnString);  

    Can you try with above changes?


    Thanks much
    Sandip

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 660 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 549 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 307 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans