Okay, I've at least narrowed it down. The problem only shows up when search criteria is specified for the purchase order relation field which is going to be the primary search field. Any non-relation search fields are fine and I also have a relation field to accounts which is fine. The purchase orders relationship was created in module builder before it was deployed and the accounts relationship was created in studio after.
Code:
SELECT inv_items.id , inv_items.name , inv_items.part_number , inv_items.item_cost , inv_items.retail_price ,
inv_items.warranty , inv_items.serial_number , jt0.name inv_purchaseorders_inv_items_name, jtl0.inv_purchashaseorders_ida
inv_purchashaseorders_ida, inv_items.assigned_user_id FROM inv_items LEFT JOIN inv_purchasrs_inv_items_c jtl0 ON
inv_items.id=jtl0.inv_purchassinv_items_idb AND jtl0.deleted=0 LEFT JOIN inv_purchaseorders jt0 ON
jt0.id=jtl0.inv_purchashaseorders_ida AND jt0.deleted=0 AND jt0.deleted=0 where ((jt0.name like 'Initial Inventory%')) AND
inv_items.deleted=0 ORDER BY inv_items.name DESC
Here is the accounts one that does work:
Code:
SELECT inv_items.id , inv_items.name , inv_items.part_number , inv_items.item_cost , inv_items.retail_price ,
inv_items.warranty , inv_items.serial_number , jt0.name accounts_inv_items_name,
jtl0.accounts_inmsaccounts_ida accounts_inmsaccounts_ida, inv_items.assigned_user_id
FROM inv_items LEFT JOIN accounts_inv_items_c jtl0 ON inv_items.id=jtl0.accounts_insinv_items_idb
AND jtl0.deleted=0 LEFT JOIN accounts jt0 ON jt0.id=jtl0.accounts_inmsaccounts_ida
AND jt0.deleted=0 AND jt0.deleted=0 where ((jt0.name like 'COMPANY%')) AND inv_items.deleted=0 ORDER BY inv_items.name DESC
I can't find any discrepancies between the two.
I tried removing the relationships in module builder and re-deploying it so I could go back and add them through studio instead, but that didn't remove any of the relationships. Of course the relationships in studio are permanent so I can't redo them. Is there maybe a way to safely remove them manually so I can go back and add them in studio? Or is it more likely because the relationship is between two custom modules unlike the accounts relationship?
Thanks everyone for all the help!
Bookmarks