Solved

Adding a new column to the Inventory Summary grid using PXDBScalar?

  • 18 February 2022
  • 1 reply
  • 441 views

Userlevel 2
Badge

I'm trying to add a column to the Inventory Summary (IN.40.10.00) grid and I feel like I must be missing something simple.

I need to output the INLocation.PickPriority value as a column which corresponds to the LocationID.

I've created this DAC extension:

public class InventorySummaryEnquiryResultExt : PXCacheExtension<PX.Objects.IN.InventorySummaryEnquiryResult>
{
#region UsrPickPriority
[PXInt]
[PXDBScalar(typeof(Search<INLocation.pickPriority,
Where<INLocation.locationID, Equal<InventorySummaryEnquiryResult.locationID>,
And<INLocation.siteID, Equal<InventorySummaryEnquiryResult.siteID>>>>))]
[PXUIField(DisplayName = "Pick Priority")]

public virtual int? UsrPickPriority { get; set; }
public abstract class usrPickPriority : PX.Data.BQL.BqlInt.Field<usrPickPriority> { }
#endregion
}

The PickPriority value is set to 999 in the Warehouses (IN.20.40.00) screen, but I can't get it to display on the Inventory Summary screen. It’s always null.

Can anyone point me in the right direction?

icon

Best answer by Naveen Boga 19 February 2022, 02:18

View original

1 reply

Userlevel 7
Badge +17

Hi, @brothe58  I also verified from my end, PXDBScalar is not fetching the values by considering LocationID and SiteID.

As an alternative, I checked with the FieldSelecting event and it is working as expected. Below is the code for your reference.

Hope this helps!

 

using PX.Data;
using PX.Objects.IN;

namespace Test
{
public class InventorySummaryEnqExt : PXGraphExtension<PX.Objects.IN.InventorySummaryEnq>
{
protected virtual void InventorySummaryEnquiryResult_UsrPickPriority_FieldSelecting(PXCache cache, PXFieldSelectingEventArgs e)
{
InventorySummaryEnquiryResult row = e.Row as InventorySummaryEnquiryResult;
if (row != null)
{
INLocation objINLocation = PXSelect<INLocation, Where<INLocation.locationID, Equal<Required<InventorySummaryEnquiryResult.locationID>>,
And<INLocation.siteID, Equal<Required<InventorySummaryEnquiryResult.siteID>>>>>.Select(Base, row.LocationID, row.SiteID);
if (objINLocation != null)
{
e.ReturnValue = objINLocation.PickPriority;
}
}
}
}
public class InventorySummaryEnquiryResultExt : PXCacheExtension<PX.Objects.IN.InventorySummaryEnquiryResult>
{
#region UsrPickPriority
[PXInt]
[PXDBScalar(typeof(Search<INLocation.pickPriority,
Where<INLocation.locationID, Equal<Current<InventorySummaryEnquiryResult.locationID>>,
And<INLocation.siteID, Equal<Current<InventorySummaryEnquiryResult.siteID>>>>>))]
[PXUIField(DisplayName = "Pick Priority")]

public virtual int? UsrPickPriority { get; set; }
public abstract class usrPickPriority : PX.Data.BQL.BqlInt.Field<usrPickPriority> { }
#endregion
}
}

 

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