在VendAgingReportDP
类insertVendAgingReportTmp
的标准代码的最后一行是vendAgingReportTmp.insert();
如果你的代码是vendAgingReportTmp.insert();
之前,您不需要进行更新。如果您在vendAgingReportTmp.insert();
之前放入vendAgingReportTmp.update();
,则会出现该错误。
把你的代码中//YourCode
和//YourCode END
withhout vendAgingReportTmp.update();
例子:
/// <summary>
/// Inserts records into the temporary <c>VendAgingReportTmp</c> table.
/// </summary>
/// <param name="_reverseAmountsAndHeadings">
/// A boolean value which indicates whether the column values should be reversed.
/// </param>
private void insertVendAgingReportTmp(boolean _reverseAmountsAndHeadings)
{
vendAgingReportTmp.AsOfDate = strFmt("@SYS84682", date2StrUsr(contract.parmZeroDate(), DateFlags::FormatAll), contract.parmDateTransactionDuedate());
vendAgingReportTmp.HeadingAccount = strFmt("@SYS24500");
vendAgingReportTmp.HeadingName = strFmt("@SYS7399");
switch (contract.parmDateTransactionDuedate())
{
case DateTransactionDuedate::DocumentDate : vendAgingReportTmp.HeadingDate = "@SYS2587";
break;
case DateTransactionDuedate::TransactionDate : vendAgingReportTmp.HeadingDate = "@SYS67";
break;
case DateTransactionDuedate::DueDate : vendAgingReportTmp.HeadingDate = "@SYS14588";
break;
default : vendAgingReportTmp.HeadingDate = "@SYS14588";
break;
}
if (_reverseAmountsAndHeadings)
{
this.setVendAgingReportTmpInReverse();
}
else
{
this.setVendAgingReportTmp();
}
vendAgingReportTmp.TransDate = tmpAccountSum.TransDate;
vendAgingReportTmp.InvoiceId = tmpAccountSum.InvoiceId;
vendAgingReportTmp.Voucher = tmpAccountSum.Voucher;
vendAgingReportTmp.AccountNum = tmpAccountSum.AccountNum;
vendAgingReportTmp.Name = vendTable.name();
vendAgingReportTmp.VendAccount = tmpAccountSum.AccountNum;
vendAgingReportTmp.Txt = tmpAccountSum.Txt;
vendAgingReportTmp.Balance = 100;
vendAgingReportTmp.CurrencyCode = tmpAccountSum.CurrencyCode;
vendAgingReportTmp.VendGroup = vendTable.VendGroup;
//YourCode
//...
//...
//...
//YourCode END
vendAgingReportTmp.insert();
}
你可以发布你的工作是不工作的代码? –
另外看看如何创建[mcve]。 –