Question

Set selected Production order's Order type in another field

  • 9 May 2024
  • 1 reply
  • 15 views

Userlevel 4
Badge +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.


1 reply

Badge +11

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


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