Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Issue on InsertPayment through eConnect

Posted on by Microsoft Employee

Hello,

Our current eConnect code for Insert Payment (taCreateSopPaymentInsertRecord_ItemsTaCreateSopPaymentInsertRecord) and Delete Hold (taSopUpdateCreateProcessHold) are both giving the error “Node taSopHdrIvcInsert with required fields is required for new SOPTransactionTypes.”.  This error seems a bit strange, because the documentation doesn’t indicate that it’s required, and they shouldn’t be “new” SOP transactions, since there is already a record in SOP10100.

I modified the code to pass in a taSopHdrIvcInsert as well, but I’m not sure it’s working correctly. I have UpdateIfExists set to 1. It’s hard to tell which fields are necessary to pass in – sometimes not giving a parameter will not affect that field, and sometimes it will delete any existing info in that field.

Someone suggested to add all fields, but there are 100s of them.

Your help is much appreciated.

Thank you!

*This post is locked for comments

  • Suggested answer
    Shahzad Ali Profile Picture
    Shahzad Ali 35 on at
    RE: Issue on InsertPayment through eConnect

    I had the same error and found the solution by making below addition in code  

    public static void SerializeSalesPaymentEntryObject(string filename)
    {
    try
    {
    DateTimeFormatInfo dateFormat = new CultureInfo("en-US").DateTimeFormat;

    // Instantiate an eConnectType schema object
    eConnectType eConnect = new eConnectType();

    // Instantiate a SOPTransactionType schema object
    SOPTransactionType transType = new SOPTransactionType();


    // Instantiate a taCreateSopPaymentInsertRecord_ItemsTaCreateSopPaymentInsertRecord XML node object
    taCreateSopPaymentInsertRecord_ItemsTaCreateSopPaymentInsertRecord[] crPaymentArr = new
    taCreateSopPaymentInsertRecord_ItemsTaCreateSopPaymentInsertRecord[1];

    taCreateSopPaymentInsertRecord_ItemsTaCreateSopPaymentInsertRecord crPayment = new
    taCreateSopPaymentInsertRecord_ItemsTaCreateSopPaymentInsertRecord();

    taSopHdrIvcInsert salesHdr = new taSopHdrIvcInsert();

    salesHdr.SOPTYPE = 3;
    salesHdr.DOCID = "STDINV";
    salesHdr.SOPNUMBE = "STDINV2405";
    salesHdr.DOCDATE = System.DateTime.Today.ToString("MM/dd/yyyy", dateFormat);
    salesHdr.CUSTNMBR = "AARONFIT0001";
    salesHdr.BACHNUMB = "AUG31";
    salesHdr.UpdateExisting = 1;

    // Create an XML serializer object
    XmlSerializer serializer = new XmlSerializer(eConnect.GetType());


    crPayment.SOPTYPE = 3;
    crPayment.SEQNUMBR = 1;
    crPayment.SOPNUMBE = "STDINV2405";
    crPayment.CUSTNMBR = "AARONFIT0001";
    crPayment.DOCDATE = System.DateTime.Today.ToString("MM/dd/yyyy", dateFormat);
    crPayment.DOCAMNT = 2.5M;
    crPayment.PYMTTYPE = 5;
    crPayment.Action = 1;
    crPayment.CHEKNMBR = "0010010001";


    crPaymentArr[0] = crPayment;


    transType.taCreateSopPaymentInsertRecord_Items = crPaymentArr;
    transType.taSopHdrIvcInsert = salesHdr;
    SOPTransactionType[] rmCashReceiptsTypeMaster = { transType };
    eConnect.SOPTransactionType = rmCashReceiptsTypeMaster;

    // Create objects to create file and write the customer XML to the file
    FileStream fs = new FileStream(filename, FileMode.Create);
    XmlTextWriter writer = new XmlTextWriter(fs, new UTF8Encoding());

    // Serialize the eConnectType object to a file using the XmlTextWriter.
    serializer.Serialize(writer, eConnect);
    writer.Close();
    }
    catch (Exception ex)
    {
    Console.Write(ex.ToString());
    }
    }

  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    Beat Bucher GP Gee... 28,021 Super User 2024 Season 1 on at
    RE: Issue on InsertPayment through eConnect

    Hi Timir,

    Have you checked the field list to see which ones are effectively required ?

    msdn.microsoft.com/.../jj193347.aspx

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

Featured topics

Product updates

Dynamics 365 release plans