Sunday, July 15, 2018

Add Element Level Event Handlers

Perform the following steps to add element or outcome level event handlers.

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

Configure the Firewall on the Enterprise Portal Server

After you install Enterprise Portal, enable Web Server (HTTP) in Windows Firewall. If you do not enable the web server in Windows Firewall...