Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Acumatica 在图形扩展中添加与新表相关的PXSearchable的最低要求是什么?_Acumatica - Fatal编程技术网

Acumatica 在图形扩展中添加与新表相关的PXSearchable的最低要求是什么?

Acumatica 在图形扩展中添加与新表相关的PXSearchable的最低要求是什么?,acumatica,Acumatica,Acumatica ERP 2018R1-构建18.107.0022 目标很简单。向Acumatica ERP库存项目屏幕添加新选项卡,以显示与项目相关的自定义数据的1对多关系 在这里提供了一些关于如何将新的PXSearchable数据放入重建全文索引屏幕的帮助之后,SearchIndex表将填充my data,显示内容字段中的标题行数据和可搜索字段。但是,显示的搜索结果只是一个冒号。。。由于标题的格式为“{0}:{1}”,因此应该分隔标题行中显示的2个数据元素的冒号 数据位于数据库表的内容字段

Acumatica ERP 2018R1-构建18.107.0022

目标很简单。向Acumatica ERP库存项目屏幕添加新选项卡,以显示与项目相关的自定义数据的1对多关系

在这里提供了一些关于如何将新的PXSearchable数据放入重建全文索引屏幕的帮助之后,SearchIndex表将填充my data,显示内容字段中的标题行数据和可搜索字段。但是,显示的搜索结果只是一个冒号。。。由于标题的格式为“{0}:{1}”,因此应该分隔标题行中显示的2个数据元素的冒号

数据位于数据库表的内容字段中,但不会显示在搜索结果中。只会出现一个带有my:的空行,这会将我带到通过搜索找到的项目的库存项目屏幕

图形扩展:

  public class InventoryItemMaint_Extension : PXGraphExtension<InventoryItemMaint>
  {
        #region Customized Data Views
        public PXSelect<MyDataTable, Where<MyDataTable.inventoryID, Equal<Current<InventoryItem.inventoryID>>>> myviewname;
        #endregion

  }
公共类InventoryItemMaint_扩展名:pxGrapherExtension
{
#区域自定义数据视图
选择myviewname;
#端区
}
DAC定义

    [Serializable]

    [PXPrimaryGraph(
        new Type[] { typeof(InventoryItemMaint) },
        new Type[] { typeof(Where<InventoryItem.stkItem, Equal<True>>) }
        )]

    [PXCacheName("My Data Description")]

    [PXBreakInheritance]

    public class MyDataTable: IBqlTable
    {
        #region BranchID
        [PXDBInt(IsKey = true)]
        [PXDefault(typeof(Current<AccessInfo.branchID>))]
        public virtual Int32? BranchID { get; set; }
        public abstract class branchID : PX.Data.IBqlField { }
        #endregion

        #region InventoryID
        [PXDBInt]
        [PXDBDefault(typeof(InventoryItem.inventoryID))]
        [PXParent(typeof(Select<InventoryItem, Where<InventoryItem.inventoryID, Equal<Current<MyDataTable.inventoryID>>>>))]
        public virtual int? InventoryID { get; set; }
        public abstract class inventoryID : IBqlField { }
        #endregion

#region MyFieldsHere
#endregion

        #region NoteID  
        public abstract class noteID : PX.Data.IBqlField
        {
        }
        protected Guid? _NoteID;
        [PXSearchable(PX.Objects.SM.SearchCategory.All, "{0}: {1}",
            new Type[] { typeof(MyDataTable.MasterDataID), typeof(MyDataTable.MySearchableDataField) },
            new Type[] { typeof(MyDataTable.MySearchableDataField) },
            NumberFields = new Type[] { typeof(MyDataTable.MySearchableDataField) },
            Line1Format = "{0} - {1}", Line1Fields = new Type[] { typeof(MyDataTable.MasterDataID), typeof(MyDataTable.MySearchableDataField) },
            Line2Format = "{0}", Line2Fields = new Type[] { typeof(MyDataTable.MySearchableDataField) },
            WhereConstraint = typeof(Where<Current<MyDataTable.active>, NotEqual<False>>)
            )]
        [PXNote]
        public virtual Guid? NoteID { get; set; }
        #endregion
[可序列化]
[PXPrimaryGraph](
新类型[]{typeof(InventoryItemMaint)},
新类型[]{typeof(Where)}
)]
[PXCacheName(“我的数据描述”)]
[遗传]
公共类MyDataTable:IBqlTable
{
#布兰奇地区
[PXDBInt(IsKey=true)]
[PXDefault(typeof(Current))]
公共虚拟Int32?BranchID{get;set;}
公共抽象类branchID:PX.Data.IBqlField{}
#端区
#区域目录ID
[PXDBInt]
[PXDBDefault(typeof(InventoryItem.inventoryID))]
[PXParent(typeof(Select))]
公共虚拟int?InventoryID{get;set;}
公共抽象类inventoryID:IBqlField{}
#端区
#MyFieldsHere地区
#端区
#区域注释ID
公共抽象类noteID:PX.Data.IBqlField
{
}
受保护的Guid?\u NoteID;
[PXSearchable(PX.Objects.SM.SearchCategory.All,“{0}:{1}”,
新类型[]{typeof(MyDataTable.MasterDataID),typeof(MyDataTable.MySearchableDataField)},
新类型[]{typeof(MyDataTable.MySearchableDataField)},
NumberFields=新类型[]{typeof(MyDataTable.MySearchableDataField)},
Line1Format=“{0}-{1}”,Line1Fields=新类型[]{typeof(MyDataTable.MasterDataID),typeof(MyDataTable.MySearchableDataField)},
Line2Format=“{0}”,Line2Fields=新类型[]{typeof(MyDataTable.MySearchableDataField)},
WhereConstraint=typeof(其中)
)]
[注]
公共虚拟Guid?NoteID{get;set;}
#端区
我使用了InventoryItem和POOrder的DAC作为示例,以及internet上的各种搜索结果。我找不到任何东西告诉我如何定义PXCacheName以使其在“名称”中显示值列显示在重建全文索引屏幕上,因此,我似乎以类似的方式错过了其他所有人都认为理所当然的东西


要使搜索结果正确显示在搜索结果屏幕上,需要做些什么?

这是为了等待评论,所以这些只是更多的问题/事情需要尝试

如果希望为dac指定缓存名称,请在dac上使用PXCacheName属性,如下所示

[Serializable]
[PXCacheName("My Cache Name")] 
public class MyDataTable: IBqlTable
{
    //...
}
示例新类型[]{typeof(MyDataTable.MasterDataID)、typeof(MyDataTable.MySearchableDataField)}中的第一组值将显示在“:”我假设它们在表中有值,并假设它们使用MyDataTable.masterDataID的小写字段名指向字段名的抽象类

我已经将自定义DAC设置为可搜索的,并且确实需要一些尝试和错误来查看显示的内容和有意义的内容

不确定这是否重要,但这些字段(MasterDataID和MySearchableDataField)是字符串字段吗? 请尝试使用不同的字段(字符串字段)进行确认?我确实使用了日期字段,但不适用于您看到为空的搜索字段

我假设对searchable属性的更改也需要重建索引


应该没有什么区别,但我使用了PX.Objects.SM.SearchCategory.IN代替了所有内容。

缺少的链接似乎是,可搜索对象需要有自己的图形/屏幕,演示层才能连接。我已将自定义数据添加为挂起库存项目的新选项卡。当重建全文索引运行时,它已被删除指向库存项目屏幕的图形,最终指向InventoryItem记录

通过为我的自定义数据创建一个专用的图形/屏幕,PXSearchable能够链接到自定义数据的图形(通过[PrimaryGraph(typeof(MyGraph))]注释)

索引正在使用预期的数据重建,因为索引重建似乎不依赖于表示层的图形定义。但是,实时搜索结果的显示确实会通过表示层,以提供可查看的屏幕结果以及到主图形的后续链接

要在将来再次执行此操作,这些似乎是必需的代码元素:

---DAC---

[PXPrimaryGraph(typeof(MyCustomDataDedicatedGraph))]
[PXCacheName("User Friendly Cache Name Displayed In Rebuild Index Screen")]

#region NoteID  
[PXSearchable(PX.Objects.SM.SearchCategory.IN, "{0}",
new Type[] { typeof(MyDataTable.myTitleField1) },
new Type[] { typeof(MyDataTable.myIndexedField1) },
NumberFields = new Type[] { typeof(MyDataTable.myIndexField1) },
Line1Format = "{0}", Line1Fields = new Type[] { typeof(MyDataTable.myDescriptionLine1Field1) },
Line2Format = "{0}", Line2Fields = new Type[] { typeof(MyDataTable.myDescriptionLine2Field1) },
WhereConstraint = typeof(Where<Current<MyDataTable.myActiveFlagField>, NotEqual<False>>)
)]
[PXNote]
public virtual Guid? NoteID { get; set; }
public abstract class noteID : IBqlField { }
#endregion

---Graph MyCustomDataDedicatedGraph---

PXSelect or PXSelectJoin the data view needed to fully
represent the data in the PXSearchable of the NoteID of the DAC
--DAC---
[PXPrimaryGraph(typeof(MyCustomDataDeliveredGraph))]
[PXCacheName(“重建索引屏幕中显示的用户友好缓存名称”)]
#区域注释ID
[PXSearchable(PX.Objects.SM.SearchCategory.IN,“{0}”,
新类型[]{typeof(MyDataTable.myTitleField1)},
新类型[]{typeof(MyDataTable.myIndexedField1)},
NumberFields=新类型[]{typeof(MyDataTable.myIndexField1)},
Line1Format=“{0}”,Line1Fields=新类型[]{typeof(MyDataTable.myDescriptionLine1Field1)},
Line2Format=“{0}”,Line2Fields=新类型[]{ty