@charlbester34 , this particular error is caused by the incorrect syntax of the Where method. It requires a lambda expression and non-static object reference (see https://docs.microsoft.com/ru-ru/dotnet/api/system.linq.enumerable.where?view=net-5.0), such as:
foreach (POLine line in Base.Transactions.Select().RowCast<POLine>().Where(line => ((POLine)line).PONbr != null))
but there are other issues with this code:
- On the following line, the GetExtension method is applied to incorrect cache reference (lines cache). Should be POOrder cache:
POOrderExt extdata = Base.Document.Cache.GetExtension<POOrderExt >(Base.Document.Current); - Also, there should be the logic setting this field to false when there are no more lines with PONbr  field filled (POLine_RowDeleted)
- foreach cycle seems redundant here, since you can use the .any method to check presence ot lines satisfying the condition. Coupled with (2), it suggests the following code:
extdata.UsrContainsBlanketPONo = Base.Transactions.Select().RowCast<POLine>().Any(line => ((POLine)line).PONbr != null);
 - since the PONbr  field is filled on line creation and cannot be edited for existing line, the appropriate place for this logic seems to be the POLine_RowInserted
Given all this, I would implemented the requested check on the BLC level as follows:
public class POOrderEntryCommCust147Ext : PXGraphExtension<POOrderEntry>
   {
      private void RecalcUsrContainsBlanketPONo()
      {
         POOrderCommCust147Ext extdata = Base.Document.Cache.GetExtension<POOrderCommCust147Ext>(Base.Document.Current);
         extdata.UsrContainsBlanketPONo = Base.Transactions.Select().RowCast<POLine>().Any(line => ((POLine) line).PONbr != null);
     }
      !PXOverride]
      public virtual void POLine_RowInserted(PXCache cache, PXRowInsertedEventArgs e, PXRowInserted baseMethod)
      {
         baseMethod(cache, e);
         //foreach (POLine line in Base.Transactions.Select().RowCast<POLine>().Where(line => line.PONbr != null))
         if (Base.Document.Current.OrderType == POOrderType.RegularOrder)
         {
            RecalcUsrContainsBlanketPONo();
         }
        Â
      }
      ÂPXOverride]
      public virtual void POLine_RowDeleted(PXCache cache, PXRowDeletedEventArgs e, PXRowDeleted baseMethod)
      {
         baseMethod(cache, e);
         //foreach (POLine line in Base.Transactions.Select().RowCast<POLine>().Where(line => line.PONbr != null))
         if (Base.Document.Current.OrderType == POOrderType.RegularOrder)
         {
            RecalcUsrContainsBlanketPONo();
         }
      }
   }
Â