I have a subcontract table with a company field. On the company page, I do not want the company to be able to be deleted if it is attached to an active subcontract. I am currently using the following expression to display the delete button. (Doesn't actually delete, just sets company to inactive.)
<% if (item.company1.subcontracts.Count == 0) { %>
This works for excluding all companies which are attached to subcontracts. However, my subcontract table also has an active_status field. What I really want is to be able to delete companies which are either not attached to a subcontract or are attached to an inactive subcontract (active_status == 0).