Emmanuel Katto from Dubai : What are the best practices for setting rules when two objects are connected to a single thing?

Hi Everyone I’m Emmanuel Katto from Dubai, United Arab Emirates (UAE), Here’s a variation of your scenario with a similar structure but different entities:


I’ve encountered an interesting challenge and wanted to share it.

Here’s an example:

I have an item, let’s say a “toolbox,” linked to two vendors, “FixItFast” and “ToolTime.” This relationship follows a many-to-many setup.

Each toolbox can be associated with multiple vendors.

Here’s a snapshot of the table: Tools & Vendors

Vendor Name Item Name
FixItFast Toolbox
ToolTime Toolbox

Now, I have a status field that gets updated when the item is used by a specific process. When it’s used, a flag is set that removes the item from the display grid.

Previously, this is how it worked:

Vendor Name Item Name
ToolTime Toolbox

This worked fine until I decided it would be useful to associate multiple vendors with a single item. So, I changed the relationship to many-to-many, enabling multiple vendors to be selected for each item.

Here’s the issue:

I currently have a rule set up where if the toolbox is marked as used, the system marks the record as “used.” But now I need a more complex rule.

I want to only mark the record as “used” if all vendors associated with the toolbox have been processed.

For example, the display grid would work like this:

Starting with:

Vendor Name Item Name
FixItFast Toolbox
ToolTime Toolbox

If “FixItFast” is processed, the grid would only show:

Vendor Name Item Name
ToolTime Toolbox

Once all vendors for the toolbox are processed, then and only then should the entire item be flagged as “used.”

I could probably come up with a workaround for this, so it’s not a huge issue, but I figured I’d ask anyway.

Regards
Emmanuel Katto

I think this could be handled by creating an intermediate object like in the example Project Free Warehouse Manager App Template | Knack.
How to Build an Inventory Manager App

The parent/child relationship between Products and purchases (or something similar) will get you what you are looking for.

2 Likes

This was my first idea here, I believe it’ll work. It would be good to get an update.