在 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;
}

posted @ 2010-01-18 16:11  Joshua_Li  阅读(107)  评论(0编辑  收藏  举报