Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP forum
Suggested answer

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

Posted on by 75,730

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(); } } } }
  • Suggested answer
    sandipdjadhav Profile Picture
    sandipdjadhav 18,252 on at
    RE: Using C# and eConnect to get next AP payment number.

    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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,532 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,501 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Product updates

Dynamics 365 release plans