1. In the AOT locate the class SalesCLApprovalEventHandler. This
class was created by the Approval element wizard.
2. Add the following code in the returned method
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | public void returned(WorkflowElementEventArgs _workflowElementEventArgs) { SalesTable SalesTable; ttsbegin; select forupdate SalesTable where SalesTable.RecId == _workflowElementEventArgs.parmWorkflowContext().parmRecId() ; SalesTable.CreditLimitApprovalStatus = SalesCreditLimitApprovalStatus::Rejected; SalesTable.update(); ttscommit; } |
3. Save your changes to the class.
4. In the AOT, right-click on the AOT node and select Incremental
CIL generation from X++
NOTE: Code run in batch jobs must first be compiled to the Common
Intermediate Language (CIL) of the .NET framework. This increases the
performance of the batch job.
Best Regards,
Hossein Karimi
No comments:
Post a Comment