Status quo: (BC18 and before)
The "Additional Grouping Identifier"-Field exists to adjust the grouping behavior of the "Invoice Post. Buffer"-Record by using the following events:
```[EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterInvPostBufferPreparePurchase', '', true, true)]```
```[EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterInvPostBufferPrepareSales', '', true, true)]```

The Problem: If you have multiple extensions subscribing to this Event, your extensions can (and probably will) overwrite each others "Additional Grouping Identifier"-Values.

Suggestion: Set the existing events obsolete. Introduce a list-variable which is used to collect the demanded Grouping Identifiers together with a fixed identification-key over a new event. After the event: sort the list by the identification key, and create a hash-value based on the values in the list-variable. Use this hash-value to fill the current "Additional Grouping Identifier"-field.

This way, all the grouping identifiers demanded by the different extensions can get their representation.

Disclaimer: I know there is an interface based alternative for the old "Invoice Post. Buffer"-Logic available now. But as several MVPs have already pointed out, this change undermines collaboration between extensions. - and to give my humble opinion: I'm a little bit confused why this has been done. Invoice posting is one of the most central features in BC and by allowing everyone to build their own version, you're making it unreliable. - We can't write events for each and every App developer that decides to create a new one. - even if they decide to provide events.
Category: Development
Needs Votes
Ideas Administrator

Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future. Best regards, Business Central Team