在 AX 中以编程方式取消销售订单
Programmatically Cancel SalesOrders in AX
我想在 AX 2009 中以编程方式取消状态为延期交货且小于特定日期的所有销售订单。
我通过 运行 以下工作
设法做到了这一点
static void SalesOrderUpdate(Args _args)
{
SalesTable salesTable;
SalesLine salesLine;
int i;
;
changecompany ('10')
{
ttsBegin;
while select forUpdate salesTable
where salesTable.SalesStatus == SalesStatus::Backorder
&& salesTable.ReceiptDateRequested <= 3116
&& salesTable.ShippingDateRequested <= 3116
join forUpdate salesLine
where salesLine.SalesId == salesTable.SalesId
{
i++;
salesLine.RemainSalesPhysical = 0;
salesLine.RemainInventPhysical = 0;
salesLine.update();
}
ttsCommit;
}
info(int2Str(i));
}
我想在 AX 2009 中以编程方式取消状态为延期交货且小于特定日期的所有销售订单。
我通过 运行 以下工作
设法做到了这一点static void SalesOrderUpdate(Args _args)
{
SalesTable salesTable;
SalesLine salesLine;
int i;
;
changecompany ('10')
{
ttsBegin;
while select forUpdate salesTable
where salesTable.SalesStatus == SalesStatus::Backorder
&& salesTable.ReceiptDateRequested <= 3116
&& salesTable.ShippingDateRequested <= 3116
join forUpdate salesLine
where salesLine.SalesId == salesTable.SalesId
{
i++;
salesLine.RemainSalesPhysical = 0;
salesLine.RemainInventPhysical = 0;
salesLine.update();
}
ttsCommit;
}
info(int2Str(i));
}