microsoft / microsoft/ALAppExtensions
Allow Custom Response Configuration for Document Rejection in InsertDocApprovalWorkflowSteps
Nobody has claimed this yet.
- Dominant language
- AL
- Stars
- 988
- Forks
- 692
- Avg merge
- 49m
- Merged PRs (30d)
- 1
Description
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:
-
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.
-
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Codeunit 1502 "Workflow Setup" and the InsertDocApprovalWorkflowSteps procedure around lines 1457-1462, especially the hard-coded InsertResponseStep call. Trace how rejection response codes are passed into workflow templates, then confirm that custom rejection behavior can be configured without forcing "Reopen Document" while preserving the standard default.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100