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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Create a RM invoice using econnect

(0) ShareShare
ReportReport
Posted on by 6
I am trying to create a RM Invoice using econnect with c# code and here is what I am doing
 
private static void CreateRMInvoice()
{
    var rmTransaction = new RMTransactionType();
    var taRMTransaction = new taRMTransaction
    {
        CUSTNMBR = /3437788/,
        RMDTYPAL = 1,
        DOCNUMBR = /45678900/,
        BACHNUMB = /2012243-RM/,
        DOCDATE = /2024-03-22/,
        DOCAMNT = 110,
        SLSAMNT = 110,
        CREATEDIST = 0
    };
    rmTransaction.taRMTransaction = taRMTransaction;
    var res = SerializeSalesInvoiceObject(rmTransaction);
    using (eConnectMethods em = new eConnectMethods())
    {
        try
        {
            em.CreateEntity(ConfigurationManager.ConnectionStrings[/GPDB/].ConnectionString, res);
            Console.WriteLine(/Done/);
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
        }
    }
}
 
private static string SerializeSalesInvoiceObject(RMTransactionType sopTransactionType)
{
    var eConnect = new eConnectType();
    RMTransactionType[] mySOPTransactionType = { sopTransactionType };
    eConnect.RMTransactionType = mySOPTransactionType;
    using (var memoryStream = new MemoryStream())
    {
        var writer = XmlWriter.Create(memoryStream, new XmlWriterSettings
        {
            Encoding = new UTF8Encoding(),
            Indent = true
        });
        var serializer = new XmlSerializer(eConnect.GetType());
        serializer.Serialize(writer, eConnect);
        memoryStream.Position = 0;
        using (var reader = new StreamReader(memoryStream))
        {
            var text = reader.ReadToEnd();
            return text;
        }
    }
}
 
 
I am able to create the entry successfully but I would like to is this approach is correct way of doing? Also after successful posting to GP I am verifying them in this table RM10201 but couldn't see an entry. In which table it will store this information
Categories:
I have the same question (0)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 577 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 309

#3
Diego Mancassola Profile Picture

Diego Mancassola 259

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans