[Event Request] Allow access to codeunit 310 "No. Series" OnSetNoSeriesLineFilters event
Describe the request
Please change OnSetNoSeriesLineFilters event on codeunit 310 "No. Series" to not "internal" and allow using it for everybody
Additional context
We have Number Series functionality modification to allow different No. Series per Responsibility Center. That was fulfilled by subscribing to events on No. Series functionality. But now all events are marked as obsolete and will be removed. I was looking how we could implement our change (which is developed 20 years ago). I think we could do that by using OnSetNoSeriesLineFilters event on codeunit 310 "No. Series". But it is "internal" event.
If it is not possible to change it to not "internal", could you please give an idea how we could implement our requirement?
I was looking to possibility to use implementation on interface "No. Series - Single", but problem is that it works on selected No. Series Line. Our requirement is to change the way how No. Series Line is selected - we need to select the Line which is defined for specific Responsibility Center (we have custom field for that). There is no interface which could be used for that. Internal work item: AB#565807
Hi @ViktorasDanielius, even though this event is internal, you can still hook into it. In your code, you can still create an event subscriber as shown below, the only thing you cannot do is triggering the event. I believe this should solve the problem for you. We also have a test which hooks into the event as well.
[EventSubscriber(ObjectType::Codeunit, Codeunit::"No. Series", OnSetNoSeriesLineFilters, '', false, false)]
local procedure OnSetNoSeriesLineFilters(var NoSeriesLine: Record "No. Series Line")
begin
// Your code here
end;
This event would allow you to change which line is selected. You can then further use the interface for more complex logic you may have.
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.
Build ID:
I created this request because I already tried to subscribe to this event, but it is not recognized - error is shown: The event 'OnSetNoSeriesLineFilters' is not found in the target.
Which BC version are you using? This works on BC25.3:
[EventSubscriber(ObjectType::Codeunit, Codeunit::"No. Series", OnSetNoSeriesLineFilters, '', false, false)]
procedure OnSetNoSeriesLineFilters(var NoSeriesLine: Record "No. Series Line")
begin
end;