我们如何在Acumatica中为自定义新屏幕添加通用搜索

问题描述 投票:2回答:1

用户要求是为新屏幕添加通用搜索,在库存模块下添加了我们的新屏幕,新屏幕也不是输入屏幕,就像用户视图屏幕一样,因此在DAC中,对于便笺ID字段,我们添加了searchable属性,但是它不起作用。

有人可以帮我提供示例代码,或者在我做错地方纠正我。还让我知道在Acumatica中是否可以为新屏幕添加可搜索属性?

提前感谢。

 #region Noteid
        public new abstract class noteid : PX.Data.BQL.BqlGuid.Field<noteid> { }
        protected Guid? _Noteid;
        [PXSearchable(PX.Objects.SM.SearchCategory.All , "{0}", new Type[] { typeof(KWLotSerialDetails.lotSerialNbr) },
            new Type[] { typeof(KWLotSerialDetails.lotSerialNbr), typeof(KWLotSerialDetails.inventoryID)},
            NumberFields = new Type[] { typeof(KWLotSerialDetails.lotSerialNbr) },
              Line1Format = "{0}{1}", Line1Fields = new Type[] { typeof(KWLotSerialDetails.lotSerialNbr), typeof(KWLotSerialDetails.inventoryID)},
              Line2Format = "{1}{2}", Line2Fields = new Type[] { typeof(KWLotSerialDetails.lotSerialNbr), typeof(KWLotSerialDetails.inventoryID) })]

        public virtual Guid? Noteid
        {
            get
            {
                return this._Noteid;
            }
            set
            {
                this._Noteid = value;
            }
        }
        #endregion
acumatica acumatica-kb
1个回答
0
投票

您绝对可以向通用表添加通用搜索。搜索被添加到DAC,而不是屏幕,因此与在“用户视图屏幕”中使用无关。重建全文索引时,您的NoteID字段将处理到SearchIndex表中。

我可能是错的,但我也认为您需要将Noteid字段转换为NoteID / noteID才能正常工作。 C#区分大小写,FullIndexRebuild.cs包含:entity.GetNestedType(“ noteID”)...因此,我因此认为找不到您的Noteid / noteid字段。

我的自定义PXSearchable NoteID字段之一:

#region NoteID
[PXNote]
[PXSearchable(PX.Objects.SM.SearchCategory.IN, "{0}",
    new Type[] { typeof(SSINItemManufacturer.manufacturerItem) },
    new Type[] { typeof(SSINItemManufacturer.manufacturerItem) },
    NumberFields = new Type[] { typeof(SSINItemManufacturer.manufacturerItem) },
    Line1Format = "{0}", Line1Fields = new Type[] { typeof(SSINItemManufacturer.manufacturerItem) },
    Line2Format = "{0}", Line2Fields = new Type[] { typeof(SSINItemManufacturer.manufacturerItem) },
    WhereConstraint = typeof(Where<Current<SSINItemManufacturer.isActive>, NotEqual<False>>),
    MatchWithJoin = typeof(InnerJoin<InventoryItem, On<InventoryItem.inventoryID, Equal<SSINItemManufacturer.inventoryID>>>),
    SelectForFastIndexing = typeof(Select2<SSINItemManufacturer, InnerJoin<InventoryItem, On<SSINItemManufacturer.inventoryID, Equal<InventoryItem.inventoryID>>>>)
    )]
public virtual Guid? NoteID { get; set; }
public abstract class noteID : PX.Data.BQL.BqlGuid.Field<noteID> { }
#endregion

还请在“重建全文本”屏幕上检查您的DAC是否为“已知”。检查屏幕SM209500以确保列出了您的DAC,如果是,请尝试在其上重建全文本索引。

© www.soinside.com 2019 - 2024. All rights reserved.