Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Notification Entries not appears [job customised workflow]

Posted on by 240

I create a customized workflow for the job with below reference link 

https://tinamenezes.wordpress.com/2017/11/25/procedure-to-create-a-customized-workflow-in-dynamics-nav-by-creating-new-workflow-events-part-1/

https://tinamenezes.wordpress.com/2017/11/25/procedure-to-create-a-customized-workflow-in-dynamics-nav-by-creating-new-workflow-events-part-2/comment-page-1/#comment-302

when I click the button "approve to job" it does not show the job entries in a "notification  Entries" table.

Kindly help me how to solve that issue

/** this is the codeUnit  Code **/

Documentation()

OnRun()

RunWorkflowOnSendJobTMforApprovalCode() : Code[128]
EXIT(UPPERCASE('RunWorkflowOnSendJobTMforApproval'));

[EventSubscriber] RunWorkflowOnSendJobTMforApproval(VAR Job : Record Job)
WorkFlowManagement.HandleEvent(RunWorkflowOnSendJobTMforApprovalCode,Job);
Job."Approval Status":=Job."Approval Status"::"Pending Approval";
Job.MODIFY(TRUE);

[EventSubscriber] RunWorkflowOnApproveApprovalRequestforJobTM(VAR ApprovalEntry : Record "Approval Entry")
JobTable.RESET;
JobTable.SETRANGE("No.",ApprovalEntry."Document No.");
IF JobTable.FINDFIRST THEN BEGIN
  JobTable."Approval Status":=JobTable."Approval Status"::Released;
  JobTable.MODIFY(TRUE);
  END;
  WorkFlowManagement.HandleEventOnKnownWorkflowInstance(RunWorkflowOnApproveApprovalRequestforJobTMCode,ApprovalEntry,ApprovalEntry."Workflow Step Instance ID");

LOCAL RunWorkflowOnApproveApprovalRequestforJobTMCode() : Code[128]
EXIT(UPPERCASE('RunWorkflowOnApprovalRequestforJobTM'));

LOCAL [EventSubscriber] AddWorkflowEventsToLibrary()
WorkflowEventHandling.AddEventToLibrary(RunWorkflowOnSendJobTMforApprovalCode,DATABASE::Job,'Send Job for Approval -Test',0,FALSE);
WorkflowEventHandling.AddEventToLibrary(RunWorkflowOnApproveApprovalRequestforJobTMCode,DATABASE::"Approval Entry",'Approve Approval Request for job -Test',0,FALSE);
WorkflowEventHandling.AddEventToLibrary(RunWorkflowOnRejectApprovalRequestforJobTMCode,DATABASE::"Approval Entry",'Reject Approval Request for job -Test',0,FALSE);
WorkflowEventHandling.AddEventToLibrary(RunWorkflowOnDelegateApprovalRequestForJobTMCode,DATABASE::"Approval Entry",'Delegate Approval Request for job -Test',0,FALSE);

LOCAL [EventSubscriber] AddWorkflowTableRelationToLibrary()
WorkflowSetup.InsertTableRelation(DATABASE::Job,0,DATABASE::"Approval Entry",22);

[EventSubscriber] RunWorkflowOnRejectApprovalRequestforJobTM(VAR ApprovalEntry : Record "Approval Entry")
WorkFlowManagement.HandleEventOnKnownWorkflowInstance(RunWorkflowOnRejectApprovalRequestforJobTMCode,ApprovalEntry,ApprovalEntry."Workflow Step Instance ID");
JobTable.RESET;
JobTable.SETRANGE("No.",ApprovalEntry."Document No.");
IF JobTable.FINDFIRST THEN BEGIN
  JobTable."Approval Status":= JobTable."Approval Status"::Rejected;
  JobTable.MODIFY(TRUE);
  END;

RunWorkflowOnRejectApprovalRequestforJobTMCode() : Code[128]
EXIT(UPPERCASE('RunWorkflowOnRejectApprovalRequestforJobTMCode'));

[EventSubscriber] RunWorkflowOnDelegateApprovalRequestForJobTM(VAR ApprovalEntry : Record "Approval Entry")
WorkFlowManagement.HandleEventOnKnownWorkflowInstance(RunWorkflowOnDelegateApprovalRequestForJobTMCode,ApprovalEntry,ApprovalEntry."Workflow Step Instance ID");
JobTable.RESET;
JobTable.SETRANGE("No.",ApprovalEntry."Document No.");
IF JobTable.FINDFIRST THEN BEGIN
  JobTable."Approval Status":=JobTable."Approval Status"::Delegated;
  JobTable.MODIFY(TRUE);
  END;

/** Approval button code **/

Send approval Test - OnAction()
IF WFEnable.CheckJobTMApprovalsWorkflowEnable(Rec) THEN
  WFEnable.OnSendJobTMforApproval(Rec);









*This post is locked for comments

  • Verified answer
    CDsilva Profile Picture
    CDsilva 4,184 on at
    RE: Notification Entries not appears [job customised workflow]

    Hi,

    You need to add this in Codeunit Notification Management. Here the Database name is your Table name.

    notif.PNG

     

  • ManishS Profile Picture
    ManishS 6,578 on at
    RE: Notification Entries not appears [job customised workflow]

    It is showing for standard documents when you send for approval.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans