Normally, I'd do all this in SQL, but the requirement is to loop through the grid in the IVTransfer form and look at the locations (and throw an error based on business logic)
So, I need to do this in the form, before the form is saved/posted.
Code below
Note that this code will work for any module (most questions are for SOP), just edit the table name