Custom Code Condition Revisited

Hello, looking for a bit of help as I cannot get the Vendor condition whether it is Approved or not to fire the BPM properly. This fires when entering a vendor in the subcontract shipment form.

Erp.Tables.Vendor Vendor;
foreach (var ttSubShipH_iterator in (from ttSubShipH_Row in ttSubShipH
                                    where string.Equals(ttSubShipH_Row.RowMod, IceRow.ROWSTATE_ADDED, StringComparison.OrdinalIgnoreCase) 
                                    || string.Equals(ttSubShipH_Row.RowMod, IceRow.ROWSTATE_UPDATED, StringComparison.OrdinalIgnoreCase)
    select ttSubShipH_Row))
{
    var ttSubShipH = ttSubShipH_iterator;
    foreach (var Vendor_iterator in (from Vendor_Row in Db. Vendor
        where Vendor_Row.Company==ttSubShipH.Company
        && Vendor_Row.VendorNum==ttSubShipH.VendorNum
        && Vendor_Row.Approved==true

    select Vendor_Row))
   {                        
    }
}

I’d want a little more info, especially the name of the method this fires on. I assume SubConShipEntry.Update, also it better be Pre-Proc or else its not gonna work.

I might do something like this (untested code)

foreach(var ssH in ttSubShipH.Where(s => s.Added() || s.Updated()))
{
var Vendor = Db.Vendor.Where(v => v.Company == ssH.Company && v.VendorNum == ssH.VendorNum && v.Approved).FirstOrDefault();
if(Vendor != null)
{
//Vendor.Name do vendor stuff
}
}

I am firing it on Pre-Proc, but instead of update I am utilizing SubconShipEntry.ChangeSubShipHVendorNumVendorID

I think if you look at the actual data passed in, you’ll find there isnt much (if anything) there. You’ll have to look up a record on your own probably based on the input parameter.

cProposedVendorNumVendorID