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 :
Microsoft Dynamics GP (Archived)

Issue on InsertPayment through eConnect

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    28,058 Moderator on at

    Hi Timir,

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

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

  • Suggested answer
    Shahzad Ali Profile Picture
    35 on at

    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());
    }
    }

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 > 🔒一 Microsoft Dynamics GP (Archived)

#1
mtabor Profile Picture

mtabor 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans