Skip to main content
Solved

Set selected Production order's Order type in another field

  • May 9, 2024
  • 1 reply
  • 31 views

Forum|alt.badge.img+1

Hi all,

 

I have a selector in SOLine grid as follows.

#region UsrProductionNbr
        [PXDBString(15)]
        [PXUIField(DisplayName = "Production Nbr")]
        [PXSelector(
            typeof(Search<AMProdItem.prodOrdID,
        Where<AMProdItem.inventoryID, Equal<Current<SOLine.inventoryID>>>>),
          typeof(AMProdItem.orderType),
            typeof(AMProdItem.prodOrdID))]
        public virtual string UsrProductionNbr { get; set; }
        public abstract class usrProductionNbr : PX.Data.BQL.BqlString.Field<usrProductionNbr> { }
#endregion

 

I have another field for production order type in the same grid as follows.
 

        #region UsrProdOrdType
        [PXDBString(5)]
        [PXUIField(DisplayName = "Prod. Order Type", Enabled = false)]
        public virtual string UsrProdOrdType { get; set; }
        public abstract class usrProdOrdType : PX.Data.BQL.BqlString.Field<usrProdOrdType> { }
        #endregion

 

I want to set the UsrProdOrdType value based on selected production order in UsrProductionNbr selector once it is selected. 

 

How can I do this?

Thanks.

Best answer by darylbowman

I think you actually have this logic backwards. The UsrProductionNbr field is only storing the ProdOrdID value, not a AMProdItem record, which means you can’t retrieve the Order Type from the selected record. The correct logic would be to first select an Order Type from UsrProdOrdType and then only show those order types in the UsrProductionNbr selector.

View original
Did this topic help you find an answer to your question?

1 reply

darylbowman
Captain II
Forum|alt.badge.img+13
  • 1742 replies
  • Answer
  • May 9, 2024

I think you actually have this logic backwards. The UsrProductionNbr field is only storing the ProdOrdID value, not a AMProdItem record, which means you can’t retrieve the Order Type from the selected record. The correct logic would be to first select an Order Type from UsrProdOrdType and then only show those order types in the UsrProductionNbr selector.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings