Skip to main content
Answer

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

  • February 18, 2022
  • 1 reply
  • 608 views

brothe58
Jr Varsity II
Forum|alt.badge.img

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?

Best answer by Naveen Boga

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

 

1 reply

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • February 19, 2022

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