Good day.
I am trying to set a custom field in my header to true if my purchase order detail line contains a blanket PO Nr.
I have created the custom field, and am currently trying to change the field in the row updated event.
I am currently getting a An object reference is required for the non-static field, method, or property 'POLine.PONbr'An object reference is required for the non-static field, method, or property 'POLine.PONbr' error.
Any help would be greatly appreciated.
Please see my code attached here
#region UsrContainsBlanketPONo
[PXDBBool]
[PXUIField(DisplayName = "Contains Blanket No")]
public virtual bool? UsrContainsBlanketPONo { get; set; }
public abstract class usrContainsBlanketPONo : PX.Data.BQL.BqlBool.Field<usrContainsBlanketPONo> { }
#endregion
protected void POLine_RowUpdated(PXCache cache, PXRowUpdatedEventArgs e)
{
var row = (POLine)e.Row;
foreach (POLine line in Base.Transactions.Select().RowCast<POLine>().Where(POLine.PONbr != null))
{
POOrderExt extdata = cache.GetExtension<POOrder>(line);
extdata.UsrContainsBlanketPONo = true;
break;
}
}