我是X ++开发的新手。我正在尝试在供应商老化报告中添加一个字段。它是以例外方式完成的。
我的问题是在运行时更新字段值。
方案下, 我们的发票字段包含“AA_BBBBBB”。我需要做的是我需要将值拆分为AA,BBBBBB并将BBBBBB更新为发票字段,将AA更新为新字段(发票类型)。
问题下,
一旦我在方法VendAgingReportDP \ insertVendAgingReportTmp中获得了可测量的VendAgingReportTmp的值,我就尝试更新上面的场景,但code is not selecting the records from VendAgingReportTmp
。有人可以帮助我完成这件事。
答案 0 :(得分:1)
在VendAgingReportDP
班级insertVendAgingReportTmp
中,标准代码的最后一行是vendAgingReportTmp.insert();
如果您的代码在vendAgingReportTmp.insert();
之前,则无需执行更新。如果您在vendAgingReportTmp.update();
之前放置vendAgingReportTmp.insert();
,则会收到该错误。
将您的代码放在//YourCode
和//YourCode END
内,而不是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();
}
答案 1 :(得分:0)
我在下面添加了一个解决方案,
谢谢,