BPM Custom Code to save Tracking number from Master Pack to Packs not working (No compile errors)

Note that you may want to send this type of request with code formatting in the future. :slight_smile:
Here is what I would write (fixed):

using (var txScope = IceContext.CreateDefaultTransactionScope())
{
       foreach(var tt in ttMasterPack.Where(tt => tt.Updated() && tt.TrackingNumber != ""))
	{
		foreach (var q in (from D in Db.MasterPackDtl.Where(D => D.Company == tt.Company && D.PackNum == tt.PackNum)
							join S in Db.ShipHead on
								new {D.Company, D.DtlPackNum} equals
								new {S.Company, DtlPackNum = S.PackNum}
							where S.TrackingNumber != tt.TrackingNumber
							select S))
		{				
			q.TrackingNumber = tt.TrackingNumber;
		}
	}
	Db.Validate();
	txScope.Complete();
}
1 Like