I have a CustomField that was created on Invoice Products. If an Invoice is created, multiple products can be added to the invoice. I need to check if any Invoice Products contain CustomField equal to XXX.
If Invoice contains any Invoice Product with CustomField = XXX, create one row on CustomTable.
The only way I can find to do this creates the "For Each" situation. I don't want multiple rows created in CustomTable. It's an "If one or more items contains CustomField = XXX, then do..." kind of a situation. It doesn't matter if 6 items contain CustomField = XXX, I only want one row in CustomTable.
The plan is to have this run once per day, at night and have it check for anything that was created the previous day.
Invoice AA created. It contains 3 products with CustomField = XXX. One row is created on CustomTable.
Invoice BB created. It contains 0 products with CustomField = XXX. No row created on CustomTable.
Invoice CC created, it contains 1 product with CustomField = XXX. One row is created on CustomTable.
Even though 3 invoices were created with a total of 4 products that contained the target value, only 2 rows were created on the table to represent it.
I can't find any information on how to do this. Everything I have tried results in the "For each..." scenario and I would en up with 4 rows created on the table.
Any help or guidance towards instructions is appreciated.
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492