ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

Forced SourceTableView has significant performance implications

Open krpr-navax opened this issue 4 years ago • 6 comments

In many ledger entry pages, the forced setting of a key in the SourceTableView property is causing significant performance decreases. Opening a page with the wrong key takes more than a minute instead of less than one second, if the correct key is being used.

For example: in the page 29 "Vendor Ledger Entries", the sorting key is set to "Entry No.". If this page is opened from the vendor card, then the filter is applied to the vender no. and better keys are available. However, the SourceTableView property takes precedence and sorts the filtered results without considering the better secondary key, causing the significant performance impact.

This applies to all ledger entry pages, where a SourceTableView was set, including (but not limited to):

  • page 20 "General Ledger Entries" (SORTING("G/L Account No.", "Posting Date"))
  • page 25 "Customer Ledger Entries" SORTING("Entry No.")
  • page 29 "Vendor Ledger Entries" SORTING("Entry No.")
  • page 5604 "FA Ledger Entries" SORTING("Entry No.")

Creating a separate page without the key in the SourceTableView is not an option, because hardly any code lines that call the standard page offer an option to overwrite this behaviour. This is also not a feasible approach for such a fundamental problem in so many different pages. One "acceptable" alternative could be the possibility to overwrite the SourceTableView property in a pageextension, but even this does not seem feasibly in this case.

Please remove the unnecessary SourceTableView from these pages.

krpr-navax avatar Mar 29 '22 11:03 krpr-navax

And then how many of your, mine, and everyone else's customers will complain that, suddenly after an update, their pages no longer sort the way they used to...? I don't know about you, but I don't really want to have to deal with going around manually 'reverting' such a change, on top of all the other work I have.

I thought SQL Server could intelligently pick the right key for filtering, separate from the sorting view. Maybe something is going wrong there.

In any case, this is an issue about the base application, not the AL language or compiler itself, so it seems off-topic.

dzzzb avatar Mar 29 '22 12:03 dzzzb

We currently have several customers who do not understand, why they have to wait about a minute to open a handfull of ledger entries, just because the wrong key is being forced onto them. This key was added in a previous version and at that time already changed the sort order of the pages. I would gladly 'revert' this change, but there is no option to influence this behaviour.

We can already set a different key to sort the results using the OnOpenPageEvent, but that doesn't help when the damage is already done by the performance impact caused by the SourceTableView property using the wrong key initially.

This topic does concern the AL language. If we had the possibility to overwrite the SourceTableView property, we could solve this ourselves by simply removing the key in a pageextension. If AL selected the correct key at first and did not force the SourceTableView property on the table initially, we wouldn't have this problem either.

If none of these AL language related possibilities can be provided, the next possibility, although causing significantly more work and long-term maintenance, would be to provide us with the ability to overwrite this page at every call throughout the system. Therefore, the much easier approach would be to remove the performance impacting key (restoring the state that had existed for years before this change was made) and, if anybody requires it in a specific order, to use the already available tools of the OnOpenPageEvent.

krpr-navax avatar Mar 29 '22 12:03 krpr-navax

the much easier approach would be to remove the performance impacting key (restoring the state that had existed for years before this change was made)

When was the change made? It sounds like you've done the research ;-)

dzzzb avatar Mar 29 '22 13:03 dzzzb

the much easier approach would be to remove the performance impacting key (restoring the state that had existed for years before this change was made)

When was the change made? It sounds like you've done the research ;-)

The first time this key appeared in the ledger entry pages was in version 10 (2017).

krpr-navax avatar Mar 30 '22 12:03 krpr-navax

I wholeheartedly agree - Microsoft should not "force" a key on its customers / partners. In terms of encapsulation the SourceTableView property should be made available for read/write access.

Joneleth84 avatar Apr 11 '22 09:04 Joneleth84

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: 43051.

JesperSchulz avatar Aug 22 '22 14:08 JesperSchulz