Our project uses the .NET SDK to post data to Intacct. When functionality is not available in the SDK, we build a custom wrapper using the .NET SDK AbstractFunction tools. In this scenario, we can create OtherReceipts using the existing SDK object (Intacct.SDK.Functions.CashManagement.OtherReceiptCreate). Since no corresponding object exists for updating an OtherReceipt, we built our own by implementing AbstractOtherReceipt.
You can see from the code below that I have attempted to include "receiveddate" which is valid according to the API documentation for update_otherreceipt. However, when I run this, I get an error message:
Response control status failure - XL03000003 XML Parse schema error: Error 1871: Element 'receiveddate': This element is not expected. Expected is one of ( description, supdocid, currency, exchratedate, exchratetype, exchrate, customfields, inclusivetax, receiptitems ).. Line: 1, column: 0. [Support ID: WMQJV%7EZbKYbWEYBRH6qXb4YLP5fwAAAAY]
This works as expected if I remove the "receiveddate" line.
Am I structuring this correctly, or is the list of fields that I get back the only fields that I can update?
public class OtherReceiptUpdate : AbstractOtherReceipt
{
public int RecordNo { get; set; }
public OtherReceiptUpdate()
: base()
{
}
public OtherReceiptUpdate(string controlId = null)
: base(controlId)
{
}
public override void WriteXml(ref IaXmlWriter xml)
{
xml.WriteStartElement("function");
xml.WriteAttribute("controlid", ControlId, true);
xml.WriteStartElement("update_otherreceipt");
xml.WriteAttribute("key", RecordNo, true);
xml.WriteElement("refid", TransactionNo);
//xml.WriteElement("receiveddate", TransactionDate, IaXmlWriter.IntacctDateFormat);
xml.WriteStartElement("receiptitems");
if (Lines.Count > 0)
{
foreach (AbstractOtherReceiptLine line in Lines)
{
line.WriteXml(ref xml);
}
}
xml.WriteEndElement(); // receiptitems
xml.WriteEndElement(); // update_otherreceipt
xml.WriteEndElement(); // function
}
}
Thank you!
Joe Donahue