-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No. Series: Ability to extend filters on finding No. Series Lines when getting new numbers #1362
Comments
I'd like get your thoughts on some things before going ahead and adding the event. There's a few points of concern:
Another option which I tend to favour is to add an interface for the GetNoSeriesLine method and let you define your own implementation. This would require a little more rework on your end but in exchange you'd gain full control. You could then add the implementation as a setting on the No. Series Line so it would be very explicit. I look forward to your comments, |
@grobyns Many thanks for your reply and time for our issues.
What are the next steps? Is it the correct way to ask for events/extensibility of BCApps/Business Foundation App by creating a bug issue on this GitHub repo in the future? Kindly regards |
Hi @dominicstarkl, For anything on BCApps the approach is to create an issue and if/when approved create the PR, that includes event requests. We will very carefully evaluate every event request to make sure it's the right event, with the right parameters and name and in the right place, and where possible, we'll promote alternatives. For this particular issue, I'll approve and you can create a PR. I'd suggest OnGetNoSeriesLineFilters (or similar) as event name and the documentation of the event publisher should make it clear the purpose is only to add additional filters to the line. I'd also add a testfield or similar check on the Series Code field to ensure we get the same series before and after the event. br/Gert |
@dominicstarkl I just noticed this issue is still open. Is anything pending or can it be closed? |
@grobyns Thanks for asking. I'm still on holidays. Cheers |
Describe the issue
In the current implementation it is not possible to set additional filters when matching No. Series Lines are filtered on getting new numbers, see procedure GetNoSeriesLine(), codeunit 304 "No. Series - Impl.".
The only way to extend the filtering right now is by subscribing to IntegrationEvent OnAfterSetNoSeriesCurrentLineFilters(), called in procedure SetNoSeriesCurrentLineFilters(), codeunit 305 "No. Series - Setup Impl.".
Obviously the No. Series Lines are filtered there for UI purposes when setting up new No. Series and not for getting new numbers as in GetNoSeriesLine().
Before the movement of No. Series module to Business Foundation filters applied to No. Series Lines could be extended by subscribing to OnNoSeriesLineFilterOnBeforeFindLast() called in SetNoSeriesLineFilter() of codeunit 396 NoSeriesManagement, which is now obsoleted.
The filtering in SetNoSeriesLineFilter() served both for UI and getting new numbers purposes, whereas in the new solution the filtering is done in separate places (codeunits 304 and 305).
Therefore OnAfterSetNoSeriesCurrentLineFilters() does not completely replace former OnNoSeriesLineFilterOnBeforeFindLast() - there is no ability to extend filters on getting new numbers as it was in the old solution.
Expected behavior
There should be the possibility of extending filters applied to No. Series Lines in GetNoSeriesLine(), codeunit 304 "No. Series - Impl.", as a partial replacement of former OnNoSeriesLineFilterOnBeforeFindLast() in order to unbreak current subscribers.
The new IntegrationEvents could be raised in the same manner as the obsoleted OnNoSeriesLineFilterOnBeforeFindLast() is currently raised. Suggested signature: OnGetNoSeriesLineOnBeforeFindLast(var NoSeriesLine: Record "No. Series Line")
Steps to reproduce
Use case: No. Series Lines are filtered by department of current user.
Example:
Additional context
No response
I will provide a fix for a bug
The text was updated successfully, but these errors were encountered: