0% found this document useful (0 votes)
9 views12 pages

Create Work Flow Manuals

The document outlines a series of code modifications and additions related to workflow and approval processes in a system. It includes changes to various code units, tables, and functions, as well as the creation of new workflows and event paths. Additionally, it provides integration events for sending and canceling employee salary approval requests, along with methods for checking approval status and finding approval entries.

Uploaded by

2024hb58518
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views12 pages

Create Work Flow Manuals

The document outlines a series of code modifications and additions related to workflow and approval processes in a system. It includes changes to various code units, tables, and functions, as well as the creation of new workflows and event paths. Additionally, it provides integration events for sending and canceling employee salary approval requests, along with methods for checking approval status and finding approval entries.

Uploaded by

2024hb58518
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

1. Table (Approval Entry (454)) in Document type add.

2. Code-unit 1501 in add code.

3. Code-unit 1501 Code add and old code change.


4. Code-unit 1520 Selected Function adds.

5. Code-unit 1521 in add code.

6. Above point No. :- 5 in Selected function in add code.


7. Code-unit 1521 in add code.

8. Code-unit 1521 in add code.


9. Code-unit 1535 in add selected function. (Refer Function Last
Page)

10. Code-unit 1535 in add code.


11. Code-unit 1535 in Function PopulateApprovalEntryArgument in
Selected Code insert.

12. Code-unit 1535 in add code.


13. Code-unit 1535 in Function SetStatusToPendingApproval in
Selected Code insert.

14. Code-unit 1535 in add code.

15. Create Page action.

16. Page Action Code.


17. Table 1509(WF Event/Response Combination) in Add Function
Name and Response/Event.

18. Table 1505(Workflow - Table Relation) in Add Table No. and


Related Table id (Approval Table).

19. Table 1520(Workflow Event) in Add Function Name, table id and


Show function name.

20. Create new work Flow and Enter Work flow name and Select a
Category.
21. Enter Work flow in Create Event.

22. Select Every Event Condition.

23. A First Event Cerate Path(Response).

24. A Second Event Create Path(Response).


25. A Third and Forth Event Create Path(Response).

26. A Fifth Event Create Path(Response).

27. A Six Event Create Path(response).

28. Enable Work Flow Click and Start Work Flow.


TrySendEmployeeSalaryApprovalRequests(VAR MonthlyTransaction :
Record "Monthly Transaction")
//DCS:KK-NS
IF MonthlyTransaction.COUNT = 1 THEN
CheckEmployeeSalaryApprovalsWorkflowEnabled(MonthlyTransaction);
REPEAT
IF
WorkflowManagement.CanExecuteWorkflow(MonthlyTransaction,WorkflowEve
ntHandling.RunWorkflowOnSendEmployeeSalaryForApprovalCode) AND
NOT HasOpenApprovalEntries(MonthlyTransaction.RECORDID)
THEN BEGIN
OnSendEmployeeSalaryForApproval(MonthlyTransaction);
LinesSent += 1;
END;
UNTIL MonthlyTransaction.NEXT = 0;

CASE LinesSent OF
0:
MESSAGE(NoApprovalsSentMsg);
MonthlyTransaction.COUNT:
MESSAGE(PendingApprovalForSelectedLinesMsg);
ELSE
MESSAGE(PendingApprovalForSomeSelectedLinesMsg);
END;
//DCS:KK-NE

CheckEmployeeSalaryApprovalsWorkflowEnabled(VAR MonthlyTransaction :
Record "Monthly Transaction") : Boolean
IF NOT

WorkflowManagement.CanExecuteWorkflow(MonthlyTransaction,WorkflowEve
ntHandling.RunWorkflowOnSendEmployeeSalaryForApprovalCode)
THEN
ERROR(NoWorkflowEnabledErr);

EXIT(TRUE);
//DCS:KK

[IntegrationEvent] OnSendEmployeeSalaryForApproval(VAR
MonthlyTransaction : Record "Monthly Transaction")
//DCS:KK
TryCancelEmployeeSalaryApprovalRequests(VAR MonthlyTransaction :
Record "Monthly Transaction")
REPEAT
IF HasOpenApprovalEntries(MonthlyTransaction.RECORDID) THEN
OnCancelEmployeeSalaryApprovalRequest(MonthlyTransaction);
UNTIL MonthlyTransaction.NEXT = 0;
MESSAGE(ApprovalReqCanceledForSelectedLinesMsg);
//DCS:KK

[IntegrationEvent] OnCancelEmployeeSalaryApprovalRequest(VAR
MonthlyTransaction : Record "Monthly Transaction")
//DCS:KK

LOCAL IsSufficientEmployeeSalaryApprover(UserSetup : Record "User


Setup";ApprovalEntryArgument : Record "Approval Entry") : Boolean
RecRef.GET(ApprovalEntryArgument."Record ID to Approve");
RecRef.SETTABLE(MonthlyTransaction);
EXIT(TRUE);
//DCS:KK

LOCAL ShowEmployeeSalaryApprovalStatus(MonthlyTransaction : Record


"Monthly Transaction")
MonthlyTransaction.FIND;
CASE MonthlyTransaction.Status OF
MonthlyTransaction.Status::Released:

MESSAGE(DocStatusChangedMsg,MonthlyTransaction.Year,MonthlyTransacti
on.Month,MonthlyTransaction.Status);
END;
//DCS:KK

LOCAL FindApprovedApprovalEntryForWorkflowUserGroup(VAR
ApprovalEntry : Record "Approval Entry";WorkflowStepInstance :
Record "Workflow Step Instance") : Boolean
WorkflowInstance.SETRANGE(Function_Name,WorkflowResponseHandling.Cre
ateApprovalRequestsCode);
WorkflowInstance.SETRANGE(Record_ID,WorkflowStepInstance."Record
ID");
WorkflowInstance.SETRANGE(Code,WorkflowStepInstance."Workflow
Code");
WorkflowInstance.SETRANGE(Type,WorkflowInstance.Type::Response);
WorkflowInstance.SETRANGE(Status,WorkflowInstance.Status::Completed)
;
WorkflowInstance.OPEN;
WHILE WorkflowInstance.READ DO
IF
WorkflowStepInstance.GET(WorkflowInstance.Instance_ID,WorkflowInstan
ce.Code,WorkflowInstance.Step_ID) THEN
IF WorkflowStepArgument.GET(WorkflowStepInstance.Argument) THEN
IF WorkflowStepArgument."Approver Type" =
WorkflowStepArgument."Approver Type"::"Workflow User Group" THEN
BEGIN

ApprovalEntry.SETRANGE(Status,ApprovalEntry.Status::Approved);
EXIT(ApprovalEntry.FINDLAST);
END;

EXIT(FALSE);

LOCAL FindOpenApprovalEntriesForWorkflowStepInstance(ApprovalEntry :
Record "Approval Entry";WorkflowStepInstance : Record "Workflow Step
Instance") : Boolean
ApprovalEntry2.SETFILTER(
"Record ID to Approve",'%1|%2',
WorkflowStepInstance."Record ID",ApprovalEntry."Record ID to
Approve");
ApprovalEntry2.SETRANGE(Status,ApprovalEntry2.Status::Open);
ApprovalEntry2.SETRANGE("Workflow Step Instance
ID",ApprovalEntry."Workflow Step Instance ID");
EXIT(NOT ApprovalEntry2.ISEMPTY);

You might also like