Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
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(); } } } }
Categories:
  • Suggested answer
    sandipdjadhav Profile Picture
    sandipdjadhav 18,265 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

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans