Skip to main content
Answer

Custom field from Inventory Item to MRP

  • July 13, 2022
  • 1 reply
  • 152 views

cmoreland
Semi-Pro III
Forum|alt.badge.img

I have a custom field on the inventory item called usrBuyerPlanner. I want to show that data in my MRP Display (AM400000) I have created a custom filed here Called usrBPCode and modified the attributes like so. 

[PXDBString]
[PXUIField(DisplayName="Buyer Planner")]
[PXFormula(typeof(Selector<AMRPDetailExt.usrBPCode, InventoryItemExt.usrBuyerPlanner>))]

However it does not appear to be pulling in the BPcode from the item. Any thoughts? 

 

Best answer by Leonardo Justiniano

Hi @cmoreland 

I would try adding a Selector to pull the value. Something like:

[PXDBString]
[PXUIField(DisplayName="Buyer Planner")]
[PXDBScalar(typeof(Search<InventoryItemExt.usrBuyerPlanner, Where<InventoryItem.InventoryID, Equal<AMRPDetail.InventoryID>>>))]
[PXSelector(typeof(Search<InventoryItemExt.usrBuyerPlanner, Where<InventoryItem.InventoryID, Equal<AMRPDetail.InventoryID>>>),
SubstituteKey = typeof(InventoryItem.inventoryCD),
DescriptionField = typeof(InventoryItem.descr))]

Edit: Please also add a selector to the field so it will format the field with the natural CD key and description if you wish

 

 

 

1 reply

Leonardo Justiniano
Jr Varsity II
Forum|alt.badge.img+4

Hi @cmoreland 

I would try adding a Selector to pull the value. Something like:

[PXDBString]
[PXUIField(DisplayName="Buyer Planner")]
[PXDBScalar(typeof(Search<InventoryItemExt.usrBuyerPlanner, Where<InventoryItem.InventoryID, Equal<AMRPDetail.InventoryID>>>))]
[PXSelector(typeof(Search<InventoryItemExt.usrBuyerPlanner, Where<InventoryItem.InventoryID, Equal<AMRPDetail.InventoryID>>>),
SubstituteKey = typeof(InventoryItem.inventoryCD),
DescriptionField = typeof(InventoryItem.descr))]

Edit: Please also add a selector to the field so it will format the field with the natural CD key and description if you wish