26.05.2010, 12:05 | #1 |
Участник
|
emeadaxsupport: When an expense line is rejected the remaining lines cannot be approved
Источник: http://blogs.msdn.com/b/emeadaxsuppo...-approved.aspx
============== In AX2009, we have workflow approvals for expenses. When using the line item type approval with expenses you may notice that when one line in an expense report is rejected the remaining lines no longer appear for approval until the whole expense report is re-submitted. Now this behavior may not be to everyone's liking - I have come across customers which would prefer that when an expense line is rejected the remaining lines should carry on being approved regardless. It is actually quite simple to achieve this with a small X++ change. But first we should understand what is actually happening here: basically when an expense line is rejected we also set the expense header to rejected, and the header status is what prevents the remaining lines from being processed. So if we prevent the header being set to rejected when a single line is rejected then we can achieve the desired behavior. So to make the change: In the workflow expenses event handler class, Classes\TrvWorkflowElemEventHandler.returned(), remove the following lines... if(TrvParameters::find().ApprovalLevel == TrvApprovalLevel::LineItem) { select firstonly ExpNumber from trvExpTrans where trvExpTrans.RecId == workflowContext.parmRecId(); TrvStateChangeManager::setDocumentStatus(trvExpTrans.ExpNumber, TrvAppStatus::Returned); } If you decide to use this, please make sure that you test it before use in any live environment, this code is given as an example only. Источник: http://blogs.msdn.com/b/emeadaxsuppo...-approved.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|