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, ...
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

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 565 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

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

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans