Monday, July 16, 2018

Enable Resubmit

1. Find the class SalesCLApprovalResubmitActionMgr.

2. Modify the
Main method and add a new method Resubmit as shown
in the following code:



 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
public static void main(Args _args)
{
SalesCLApprovalResubmitActionMgr
SalesCLApprovalResubmitActionMgr = new
SalesCLApprovalResubmitActionMgr();
SalesCLApprovalResubmitActionMgr.resubmit(_args);
}
private void resubmit(Args _args)
{
// Variable declaration.
recId _recId = _args.record().RecId;
WorkflowCorrelationId _workflowCorrelationId;
// Hardcoded type name
WorkflowTypeName _workflowTypeName =
workflowtypestr(SalesCreditLimitAppr);
// Initial note is the information that users enter
when they
// submit the document for workflow.
WorkflowComment _initialNote ="";
WorkflowWorkItemActionDialog
WorkflowWorkItemActionDialog;
SalesTable SalesTable;
;
// Opens the submit to workflow dialog.
workflowWorkItemActionDialog =
WorkflowWorkItemActionDialog::construct(
_args.caller().getActiveWorkflowWorkItem(),
WorkflowWorkItemActionType::Resubmit,
new MenuFunction(menuitemactionstr(PurchReqReSubmit),
MenuItemType::Action));
workflowWorkItemActionDialog.run();
if (WorkflowWorkItemActionDialog.parmIsClosedOK())
{
_recId = _args.record().RecId;
SalesTable = _args.record();
// Get comments from the submit to workflow dialog.
_initialNote =
workflowWorkItemActionDialog.parmWorkflowComment();
try
{
ttsbegin;
WorkflowWorkItemActionManager::dispatchWorkItemAction(
_args.caller().getActiveWorkflowWorkItem(),
_initialNote,
curUserId(),
WorkflowWorkItemActionType::Resubmit,
_args.menuItemName(),
false);
SalesTable.CreditLimitApprovalStatus =
SalesCreditLimitApprovalStatus::Submitted;
// Send an Infolog message.
info("Resubmitted to workflow.");
ttscommit;
}
catch(exception::Error)
{
info("Error on workflow activation.");
}
}
_args.caller().updateWorkFlowControls();
}

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...