E10: "Attempt to lock records with no transaction in effect detected

Hi All,

I am converting a BPM that populates a field from the header down to all lines if it is changed.
Specifically, we manage the Project ID for a sales order at the header level. We created a custom field on the header and if this changes, it is should populate down to OrderDtl.ProjectID on all lines.

This works well in E9, with the slight issue that we have to refresh the order afterwards, which we are living with.

In E10, the updates to the lines take place but afterwards, we get an error that says “Attempt to lock records with no transaction in effect detected.”

Below is my code. Any ideas on how to address this error?
I tried using a transaction scope with no luck.

int numOfLines = 0;

foreach (var ttOHead in (from ttOrderHed_Row in ttOrderHed
where ttOrderHed_Row.Company == Session.CompanyID
select ttOrderHed_Row))
foreach (var ODtl in (from OrderDtl_Row in Db.OrderDtl
where OrderDtl_Row.Company == ttOHead.Company
&& OrderDtl_Row.OrderNum == ttOHead.OrderNum
select OrderDtl_Row))
ODtl.ProjectID = (string)ttOHead["ShortChar01"];
numOfLines = numOfLines + 1;

if (numOfLines > 0)
this.PublishInfoMessage("REFRESH NEEDED\n\nSales order lines were updated while saving the order.\nYou will need to refresh the order before making any other changes.", Ice.Common.BusinessObjectMessageType.Information, Ice.Bpm.InfoMessageDisplayMode.Individual, "SalesOrder", "Update");

Joe Rojas | Director of Information Technology | Mats Inc
dir: 781-573-0291 | cell: 781-408-9278 | fax: 781-232-5191

addr: 179 Campanelli Pkwy | Stoughton | MA | 02072-3734
jrojas@... | www.matsinc.com
Ask us about our clean, green and beautiful matting and flooring

This message is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the company.

[Non-text portions of this message have been removed]