在 Dynamics AX 2009 中批量暂停所有包含逾期未付款的客户
static void PauseExpirationCustomer(Args _args)
{
custTable CustTable;
custTransOpen CustTransOpen;
ttsbegin;
while select forupdate custTable
{
select AccountNum
from custTransOpen
where (custTransOpen.AccountNum==custTable.AccountNum) && (custTransOpen.DueDate>systemdateget());
if (custTransOpen)
{
custTable.Blocked = CustVendorBlocked::All;
custTable.doUpdate();
}
}
ttscommit;
}