How to get the count of open invoices for each supplier

I have a use case where I want to show the number of open invoices for every supplier in a supplier search mini-app. I don’t want to create a real table field in the Directory Extension table to capture it; I see that approach being expensive as the underlying logic has to always keep the table field in sync with the state of the invoices. My thought is to do this:

  1. define a work field OpenInvoiceCount in the Directory Extension table
  2. query the invoices table and find out the count of open invoices for each vendor
  3. populate the count into the work field OpenInvoiceCount

Question: How can I implement the above in NextWorld?

You can use a work field via an extension/customization of the supplier search mini app that gets populated using the Load Data on List Form event at run time. This would incur a run-time performance penalty.

If you are able to switch to a whole new search app, you could:

  • create a table that tracks how many open invoices a supplier has and keep it up to date the same way a Cube works
  • join that table to the directory table and create an app over it
    However search apps are currently tightly coupled to applications and data items in Nextworld and changing them out via customization or similar when utilizing a base application isn’t currently possible, so this approach would only work for owned data items or applications.