Access & update all rows of orderdtl table from sales order entry

At the top of this?

/* update CoCRequired_c */

Ice.Diagnostics.Log.WriteEntry("start update CoCRequired_c");
 
SalesOrderSvcContract salesBO = Ice.Assemblies.ServiceRenderer.GetService<SalesOrderSvcContract>(Db);

using (var txscope = IceDataContext.CreateDefaultTransactionScope()) 
{
            
SalesOrderTableset salesOrder = salesBO.GetByID(iOrderNum);
            


foreach (var ttOrderHeadRow in (from ttOrderHead_Row in salesOrder.OrderHed select ttOrderHead_Row))
{


    foreach (var ttOrderDtlRow in (from ttOrderDtl_Row in salesOrder.OrderDtl select ttOrderDtl_Row))
    {
    
     Ice.Diagnostics.Log.WriteEntry($" In OrderDtl {ttOrderDtlRow.OrderNum}  CoCRequired_c {ttOrderDtlRow.UDField<bool>("CoCRequired_c")}");
      ttOrderDtlRow.SetUDField<bool>("CoCRequired_c",ttOrderHeadRow.UDField<bool>("COCRequired2_c"));
     
     }

}


salesBO.Update(ref salesOrder);
dsHolder.Attach(salesOrder);

txscope.Complete();
}

Ice.Diagnostics.Log.WriteEntry("End update CoCRequired_c");

Edited

I believe it would like I changed the code above.

Thank you.
I just tried and it didnt work.
It would save the changes made only when I make changes on the line level anywhere:

Sorry. I don’t what is missing. My last thing to try would be to make the ttOrderDtlRow.RowMod = β€œU”

No worries. Thank you so much for your help.
That will be in the code as well?

yes. in the detail foreach loop

ttOrderDtlRow.RowMod = "U";