Skip to content
This repository was archived by the owner on Oct 19, 2026. It is now read-only.
This repository was archived by the owner on Oct 19, 2026. It is now read-only.

Allow Custom Response Configuration for Document Rejection in InsertDocApprovalWorkflowSteps #29654

Closed

Description

@Jeremy-Chaing

Why do you need this change?

Currently, the InsertDocApprovalWorkflowSteps function in Codeunit 1502 "Workflow Setup" automatically inserts a hard-coded "Reopen Document" response when an approval request is rejected (line 1457-1462). While this behavior works for standard BC documents, it creates limitations for custom approval workflows where different business logic is required upon rejection.

Benefits of this change:

  1. Enable Custom Status Handling on Rejection: Extensions could configure workflow templates to set documents to custom statuses (e.g., "Rejected", "Declined", "Canceled") when approval is rejected, rather than always reverting to "Open" status. This provides better audit trails and clearer document lifecycle management.

  2. Improved User Experience: End users would no longer need to manually modify the workflow create from workflow templates to replace the default "Reopen Document" response with custom responses. The desired rejection behavior could be built into the workflow template from the start, making the solution more user-friendly and reducing configuration complexity.

Describe the request

Current Behavior:
In Codeunit 1502 "Workflow Setup", the InsertDocApprovalWorkflowSteps procedure contains the following hard-coded logic at approximately line 1462:

InsertResponseStep(Workflow, WorkflowResponseHandling.OpenDocumentCode(), RejectAllApprovalsResponseID)

This automatically inserts "Reopen Document" as a response to all rejection events, with no option to override or customize this behavior.

Requested Change:
Add an optional parameter or configuration mechanism to InsertDocApprovalWorkflowSteps that allows developers to specify custom response codes for the rejection scenario.

Internal work item: AB#620283

Activity

  1. AleksandricMarko commented on Oct 14, 2026

    @AleksandricMarko
    Contributor

    Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    SCMGitHub request for SCM areaext-ready-to-implementReviewed and ready to implement and create PRextensibility-enhancementNew feature or request related to extensibility

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions