Solved

Why is my custom field on ProductionOrderPrintProcessFilter DAC extension not returning a value?

  • 25 May 2023
  • 1 reply
  • 81 views

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
}
}

 

Custom selector on Print Production Orders screen

Is there something I’m missing when extending the ProductionOrderPrintProcessFilter?

 

Thank you.

icon

Best answer by Zoltan Febert 1 June 2023, 00:34

View original

1 reply

Userlevel 6
Badge +3

Did you set CommitChanges to True for your new field?

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved