Skip to main content
Answer

How to use subitems on the new screen ?

  • May 20, 2024
  • 2 replies
  • 103 views

Forum|alt.badge.img

I Make New Scene I need List Subitem Input type , I make new DAC. I try to check the Subitem but no value if I press f3 Any . why is this even though the table subitem has a value ?

 

This My new Screen

 

Thi table 
My Sub item many value

 



This My DAC Code 

using PX.Data;
using PX.Objects.CS;
using PX.Objects.IN;
using PX.Objects.PO;
using System;

namespace Car
{
    [Serializable]
    [PXCacheName("DetailDAC")]
    public class DetailDAC: IBqlTable
    {
        #region DocumentID
        [PXDBString(30, IsUnicode = true, InputMask = "")]
        [PXUIField(DisplayName = "Document ID")]
        public virtual string DocumentID { get; set; }
        public abstract class documentID : PX.Data.BQL.BqlString.Field<documentID> { }
        #endregion

        #region InventoryID
        [PXDBInt]
        [PXUIField(DisplayName = "Inventory ID")]
        [PXSelector(
        typeof(Search<InventoryItem.inventoryID>),
        typeof(InventoryItem.inventoryCD),
        typeof(InventoryItem.descr),
        SubstituteKey = typeof(InventoryItem.inventoryCD),
        DescriptionField = typeof(InventoryItem.descr)
        )]
        public virtual int? InventoryID { get; set; }
        public abstract class inventoryID : PX.Data.BQL.BqlString.Field<inventoryID> { }
        #endregion


        #region SubItemID
        [PXDBInt]
        [PXUIField(DisplayName = "Sub Item")]
        [SubItem(
            typeof(INSubItem.subItemID))]
        public abstract class subItemID : PX.Data.BQL.BqlInt.Field<subItemID> { }
        public virtual int? SubItemID { get; set; }
        #endregion


}

Best answer by Chris Hardgrove

Try this...
[SubItem(
            typeof(DetailDAC.inventoryID))]

Be sure that your InventoryID field has the property CommitChanges = true, within the aspx.

For  longevity, it’s best to move away from subitems, as mentioned above.

2 replies

aaghaei
Captain II
Forum|alt.badge.img+10
  • Captain II
  • May 20, 2024

@Febri 

Just a heads up that Subitem in Acumatica is being deprecated and possibly your investment will become obsolete.


Chris Hardgrove
Jr Varsity I

Try this...
[SubItem(
            typeof(DetailDAC.inventoryID))]

Be sure that your InventoryID field has the property CommitChanges = true, within the aspx.

For  longevity, it’s best to move away from subitems, as mentioned above.