web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Rejection is not working in D365 custom workflow

(0) ShareShare
ReportReport
Posted on by

Hello Guys i have designed a custom workflow step by step following this link (link). everything is working fine the issue is with the rejection of document when a approver reject the document workflow status doesn't changes  it remains submit only. I have these questions 

1.which event handler should i implant for rejection method 

2. What method we should use for handling rejection

In  view workflow details it shows rejected by : user also i am receiving email for record returned. but status remains same as submit. please find the screen shot below.

View Workflow status:

Error42.PNG

Status in form : 

Error43.PNG

i can see all three method written in event handler class handles below .

started: Submit workflow

canceled: Cancelled workflow 

completed: Approved workflow 

then what is the method for rejection. please see my code below for event handler class.

Error44.PNG

I found one thread (Link) but unanswered , i understand since there is no method to handle rejection that's why status is not changing.  In blog rejection is handled by canceled method , i am not sure why  as when i was canceling document it was falling in Rejected status so i corrected it. 

please advise for this also correct me if i am wrong anywhere in my explanation. 

Thanks 

I have the same question (0)
  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Sachin,

    Have you mentioned the Canceled Event Handler in the workflow type?

  • Community Member Profile Picture
    on at

    Hello Gunjan,

    yes its mentioned. please see below.

    8372.Error45.PNG

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Sachine,

    Do you have any class mentioned for the Canceled Menu item? You can check the PurchTableWorkflowCancel menu item as an example.

  • Community Member Profile Picture
    on at

    Hello Gunjan , i have "WorkflowCancelWorkflowFormAdaptor" class for Cancel menu item and "WorkflowWorkItemActionManager" class for my DRFWorkflowApprovalReject menu item. this "DRFWorkflowApprovalReject " menu item i want to use to reject the document.

    Please find the screen shot below.

    1.DRFWorkflowApprovalReject  menu item

    Error47.PNG

    2. cancel menu item

    Error46.PNG

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Could you try setting the Canceled Menu item in the Workflow template to the "DRFWorkflowApprovalReject" menu item and check if that works?

  • Community Member Profile Picture
    on at

    Gunjan i am sorry , could you please explain what do you mean by template to the "DRFWorkflowApprovalReject" menu item. where to find it. i am new to D365 not aware of much terms.

  • Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi Sachin,

    Please change the menu item name in the highlighted section to "DRFWorkflowApprovalReject" -

    pastedimage1603281771488v1.png

  • Community Member Profile Picture
    on at

    Hello Gunjan , i have tried what you advised its not working first it was giving below error.

    Error48.PNG

    Then i change class in BG_DRFWFType1CancelMenuItem from WorkflowCancelWorkflowFormAdaptor to  WorkflowWorkItemActionManager then it complied sucessfully but that status issue remains same. still shows submit not rejected 

  • Community Member Profile Picture
    on at

    Hello Guys , My issue for Rejection workflow status has been solved i have followed this blog (link) and write canceled,completed, denied , returned method in the WorkflowApprovalEventHandler class. also i have changed enum to Rejected in canceled method of WFType1EventHandler class. 

    Now approve and reject is working fine but issue is happening with cancel i am getting below error when i click on cancel. 

    Error49.PNG

    Please find the code screen shot of my class 

    1.WorkflowApprovalEventHandler 

    Error50.PNG

    2. BG_DRFWFType1EventHandler

    Error51.PNG

    Please advise for the cancel menu item error , i have defined "WorkflowWorkItemActionManager" class in Cancel menu item i tried changing the class but doesn't work. also i tried writing Cancelled enum in canceled method of DWorkflowApprovalEventHandler class but issue still the same. 

    Thanks 

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 559 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 464 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 250 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans