Modify PurchTableDocument Query

I need to modify the PurchTableDocument query to add the table InventTable and use a field that I create. I need to ask first in the purch workflow if the PurchLine.Qty is more or equal ( >= ) than InventTable.MyField. If that is true, I need to ask for approval, if it’s false, the Workflow will continue as normal.