[EVENT] Also add RecordID to the current event that is already there.
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 74/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend-api-design
Research direction
Start in codeunit 1535 "Approvals Mgmt." and locate FindOpenApprovalEntryForCurrUser and its OnFindOpenApprovalEntryForCurrUserOnAfterApprovalEntrySetFilters event. Update the event invocation and declaration to include RecordID, then verify that the codeunit compiles and the event exposes both ApprovalEntry and RecordID to subscribers.
Written by the indexing model from the issue text.
Description
Why do you need this change?
I need to build a different filter for the Approval Entry and I need the RecordID for this.
Describe the request
In codeunit 1535 "Approvals **Mgmt." there is this function
procedure FindOpenApprovalEntryForCurrUser(var ApprovalEntry: Record "Approval Entry"; RecordID: RecordID): Boolean
begin
ApprovalEntry.SetRange("Table ID", RecordID.TableNo);
ApprovalEntry.SetRange("Record ID to Approve", RecordID);
ApprovalEntry.SetRange(Status, ApprovalEntry.Status::Open);
ApprovalEntry.SetRange("Approver ID", UserId);
// Initial check before performing an expensive query due to the "Related to Change" flow field.
if not ApprovalEntry.IsEmpty() then
ApprovalEntry.SetRange("Related to Change", false);
**OnFindOpenApprovalEntryForCurrUserOnAfterApprovalEntrySetFilters(ApprovalEntry);**
exit(ApprovalEntry.FindFirst());
end;
In here there is the event OnFindOpenApprovalEntryForCurrUserOnAfterApprovalEntrySetFilters. It now olny contains the Approval Entry. I would also like to include the RecordID
SO the function becomes
procedure FindOpenApprovalEntryForCurrUser(var ApprovalEntry: Record "Approval Entry"; RecordID: RecordID): Boolean
begin
ApprovalEntry.SetRange("Table ID", RecordID.TableNo);
ApprovalEntry.SetRange("Record ID to Approve", RecordID);
ApprovalEntry.SetRange(Status, ApprovalEntry.Status::Open);
ApprovalEntry.SetRange("Approver ID", UserId);
// Initial check before performing an expensive query due to the "Related to Change" flow field.
if not ApprovalEntry.IsEmpty() then
ApprovalEntry.SetRange("Related to Change", false);
**OnFindOpenApprovalEntryForCurrUserOnAfterApprovalEntrySetFilters(ApprovalEntry, RecordID);**
exit(ApprovalEntry.FindFirst());
end;
and the event becomes
[IntegrationEvent(false, false)]
local procedure OnFindOpenApprovalEntryForCurrUserOnAfterApprovalEntrySetFilters(var ApprovalEntry: Record "Approval Entry";RecordID: RecordID)
begin
end;
Provide an implementation (optional)
- I will provide the implementation for this extensibility request
- Dominant language
- AL
- Stars
- 683
- Forks
- 459
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 621
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.
More from microsoft/BCApps
-
Team: Finance
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Approved event-request ext-ready-to-implement Team: Finance
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Approved event-request ext-ready-to-implement Team: SCM
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
event-request Team: SCM
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Team: SCM
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
All issues in microsoft/BCApps
Similar issues
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100