Показать сообщение отдельно
Старый 22.04.2010, 23:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
Dynamics AX Sustained Engineering: How to prevent transaction reversal from posting to closed dimensions
Источник: http://blogs.technet.com/dynamicsaxs...imensions.aspx
==============

Current behavior of Dynamics AX allows for transaction reversals to post without a warning or error message when the reversal will post to a dimension that is closed. If you wish to have a message appear to stop the reversal, this can be achieved by making the following modification. Please note that the reversal process will be blocked by this code if the posting will affect a closed dimension so you will need to create an entry manually through a journal to reverse the effects of the transaction originally intended to be reversed.

The change would be made to \Classes\LedgerVoucherTransObject\check.

From:

...

// Find the account and then call the instance based nethods to validate the account.
ledgerTable = LedgerTable::find(ledgerTrans.AccountNum);
ok = ledgerTable.checkPostingType(ledgerTrans.Posting,false) && ok;
ok = Dimensions::checkDimension(ledgerTrans.Dimension, true,
_ledgerVoucher.parmCheckBlockedDimensions()) && ok;
ok = LedgerTable::checkDimension(ledgerTrans.AccountNum, ledgerTrans.Dimension) && ok;


ok = appl.dimensionSetValidation(false, company).checkDimension(ledgerTrans,
fieldnum(LedgerTrans, Dimension),
false, false, true) && ok;
ok = ledgerTable.checkUserId(curuserid()) && ok;


ok = ledgerTable.checkAccountCurrency(ledgerTrans.CurrencyCode,
(ledgerTrans.Posting == LedgerPostingType::ExchRateGain ||
ledgerTrans.Posting == LedgerPostingType::ExchRateLoss)) && ok;
}


// Validating amount

...

To:

...

// Find the account and then call the instance based nethods to validate the account.
ledgerTable = LedgerTable::find(ledgerTrans.AccountNum);
ok = ledgerTable.checkPostingType(ledgerTrans.Posting,false) && ok;
ok = LedgerTable::checkDimension(ledgerTrans.AccountNum, ledgerTrans.Dimension) && ok;


ok = appl.dimensionSetValidation(false, company).checkDimension(ledgerTrans,
fieldnum(LedgerTrans, Dimension),
false, false, true) && ok;
ok = ledgerTable.checkUserId(curuserid()) && ok;


ok = ledgerTable.checkAccountCurrency(ledgerTrans.CurrencyCode,
(ledgerTrans.Posting == LedgerPostingType::ExchRateGain ||
ledgerTrans.Posting == LedgerPostingType::ExchRateLoss)) && ok;
}


//Validate dimension

ok = Dimensions::checkDimension(ledgerTrans.Dimension, true,
_ledgerVoucher.parmCheckBlockedDimensions()) && ok;


// Validating amount

...







Источник: http://blogs.technet.com/dynamicsaxs...imensions.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.