Hi I have a UDF (APRegisterExt.usrMAINMAINAPKynectionRefNo) which I need to this field’s value under the Supplier Details UDF (APDocumentResultExt.usrMAAPSDKynectionRefNo)


I have added the logic below but receive the following error:
\App_Code\Caches\APDocumentEnq.cs(31): error CS0246: The type or namespace name 'APDocumentResult' could not be found (are you missing a using directive or an assembly reference?)
public class APDocumentEnq_Extension : PXGraphExtension<PX.Objects.AP.APDocumentEnq>
{
#region Event Handlers
protected void APDocumentResult_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
{
var row = (APDocumentResult)e.Row;
if (row == null) return;
var docResultExt = cache.GetExtension<APDocumentResultExt>(row);
var apDoc = PXSelect<APRegister,
Where<APRegister.refNbr, Equal<Required<APRegister.refNbr>>,
And<APRegister.docType, Equal<Required<APRegister.docType>>>>>
.Select(Base, row.RefNbr, row.DocType)
.RowCast<APRegister>()
.FirstOrDefault();
if (apDoc != null)
{
var apRegisterExt = PXCache<APRegister>.GetExtension<APRegisterExt>(apDoc);
docResultExt.UsrMAAPSDKynectionRefNo = apRegisterExt.UsrMAINMAINAPKynectionRefNo;
}
}
#endregion
}
}Please let me know if using this event handler or field selecting is the best approach. Any insight would be appreciated, thank you!