I added a new column to the grid in the "Prepare Replenishment" screen (IN50800) please refer the image below:
Please note that I have marked the column header which is added as a custom column.
Please refer the code below:
namespace PX.Objects.IN.S
{
public class INItemSiteExt : PXCacheExtension<INItemSite>
{
public class ProgNameAttributeID : BqlString.Constant<ProgNameAttributeID>
{
public ProgNameAttributeID() : base("PROGNAME") { }
}
#region UsrProgramName
PXString(255, IsUnicode = true)]
PXUIField(DisplayName = "Program Name")]
public virtual string UsrProgramName { get; set; }
public abstract class usrProgramName : BqlString.Field<usrProgramName> { }
#endregion
}
}
Graph extension:
namespace PX.Objects.IN
{
public class INReplenishmentCreate_Extension : PXGraphExtension<INReplenishmentCreate>
{
#region Event Handlers
protected void INReplenishmentItem_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
{
INReplenishmentItem row = e.Row as INReplenishmentItem;
if (row == null) return;
var item = (InventoryItem)PXSelectorAttribute.Select<INReplenishmentItem.inventoryID>(cache, row);
if (item != null)
{
var attribute = (CSAnswers)PXSelect<CSAnswers,
Where<CSAnswers.refNoteID, Equal<Required<InventoryItem.noteID>>,
And<CSAnswers.attributeID, Equal<Required<CSAnswers.attributeID>>>>>
.Select(Base, item.NoteID, "PROGNAME");
if (attribute != null)
{
cache.SetValueExt<INItemSiteExt.usrProgramName>(row, attribute.Value.Trim());
}
}
}
#endregion
}
}
With above code it populates the values to the new added column but if I want to filter by it. Like below:
It doesn't filter most of the values, but sometimes it searches the first row of the grid. Otherwise it shows nothing.
Can anyone find any issues here or missing thing?