Screen modifying: Print Production Orders (AM511000) - in version 22R2
Overall Goal: Pass Report ID from custom selector to be used in the print report process instead of reportID off line item.
Issue: custom field returns null instead of selected value
I have created a custom selector that lists Report IDs from the AM module on the Print Production Orders form, and I have modified the BuildReportRequiredException method so that I can pass the selected Report ID through to be printed for any processed records. However my custom field in the ProductionOrderPrintProcessFilterExt DAC extension is returning a null value every time instead of the selected value.
Note: I’ve even tried creating a simple text field within the DAC extension and that also returns null when trying to process the record instead of the value entered.
Graph Extension:
namespace PX.Objects.AM
{
[PXProtectedAccess]
public class ProductionOrderPrintProcess_Extension :
PXGraphExtension<PX.Objects.AM.ProductionOrderPrintProcess>
{
[PXLocalizable]
public class ReqMessage : PX.Data.BQL.BqlString.Constant<ReqMessage>
{
public const string reqMess = "Print Production Report ID required.";
public ReqMessage() : base("Print Production Report ID required.") { }
}
#region Event Handlers
[PXOverride]
public virtual PXReportRequiredException
BuildReportRequiredException(PrintProductionOrders prodItem,
Dictionary<string, string> parameters, string reportID, PXReportRequiredException ex)
{
ProductionOrderPrintProcessFilter row = Base.Filter.Current;
ProductionOrderPrintProcessFilterExt pExt =
row.GetExtension<ProductionOrderPrintProcessFilterExt>();
if (pExt == null) throw new PXException(ReqMessage.reqMess);
var repID = pExt.UsrPrintProdReportID;
if (string.IsNullOrEmpty(repID)) throw new PXException(ReqMessage.reqMess);
reportID = repID;
return PXReportRequiredException.CombineReport(ex, reportID, parameters);
}
#endregion
}
}
I’m able to see that my extension is returned properly as pExt is not returned null, however the field being accessed (UsrPrintProdReportID) is returning null.
DAC Extension:
namespace PX.Objects.AM
{
[PXProjection(typeof(Select<NotificationSetup,
Where<NotificationSetup.module, Equal<PXModule.rq>>>), Persistent = true)]
public class ProductionOrderPrintProcessFilterExt :
PXCacheExtension<PX.Objects.AM.ProductionOrderPrintProcess.ProductionOrderPrintProcessFilter>
{
public class ConString : PX.Data.BQL.BqlString.Constant<ConString>
{
public ConString() : base("AM6250") { }
}
#region UsrPrintProdReportID
[PXString(15, InputMask = "CC.CC.CC.CC")]
[PXUIField(DisplayName = "Print Production Report ID")]
[PXSelector(typeof(Search<PX.SM.SiteMap.screenID,
Where<PX.SM.SiteMap.screenID, Like<Common.AMwildcard_>,
And<PX.SM.SiteMap.url, Like<PX.Objects.Common.urlReports>>>,
OrderBy<Asc<PX.SM.SiteMap.screenID>>>), typeof(PX.SM.SiteMap.screenID),
typeof(PX.SM.SiteMap.title),
Headers = new string[] { PX.Objects.CA.Messages.ReportID,
PX.Objects.CA.Messages.ReportName },
DescriptionField = typeof(PX.SM.SiteMap.title))]
public virtual string UsrPrintProdReportID
{
get { return this._UsrPrintProdReportID; }
set { this._UsrPrintProdReportID = value; }
}
public abstract class usrPrintProdReportID :
PX.Data.BQL.BqlString.Field<usrPrintProdReportID> { }
protected string _UsrPrintProdReportID;
#endregion
#region UsrTestReportID
[PXString(15)]
[PXUIField(DisplayName = "TestReportID")]
public virtual string UsrTestReportID { get; set; }
public abstract class usrTestReportID :
PX.Data.BQL.BqlString.Field<usrTestReportID> { }
#endregion
}
}

Is there something I’m missing when extending the ProductionOrderPrintProcessFilter?
Thank you.
Best answer by Zoltan Febert
View original