Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/video/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 如何将链接实体中的字段包含到全文实体索引中?_Acumatica_Acumatica Kb - Fatal编程技术网

Acumatica 如何将链接实体中的字段包含到全文实体索引中?

Acumatica 如何将链接实体中的字段包含到全文实体索引中?,acumatica,acumatica-kb,Acumatica,Acumatica Kb,我已将客户位置添加到全文实体索引中,但无法确定如何从位置获取地址行1,使其成为全文索引的一部分并显示在结果中。包含链接实体的字段(在数据输入屏幕上与顶级实体处于一对一关系的实体),需要指定与PXSelectorAttribute一起使用的顶级实体字段来检索链接实体。在顶级实体字段充当链接实体之间的桥梁之后,您将指定辅助实体的字段,这些字段应包含在全文索引中和/或显示在结果。请记住,只有用PXSelectorAttribute或PXDimensionSelectorAttribute修饰的顶级实体

我已将客户位置添加到全文实体索引中,但无法确定如何从位置获取地址行1,使其成为全文索引的一部分并显示在结果中。

包含链接实体的字段(在数据输入屏幕上与顶级实体处于一对一关系的实体),需要指定与PXSelectorAttribute一起使用的顶级实体字段来检索链接实体。在顶级实体字段充当链接实体之间的桥梁之后,您将指定辅助实体的字段,这些字段应包含在全文索引中和/或显示在结果。请记住,只有用PXSelectorAttribute或PXDimensionSelectorAttribute修饰的顶级实体字段才能充当链接实体之间的桥梁

例如,要将地址DAC中的字段包括到客户位置全文实体索引中,您必须在列出地址DAC中的字段之前,添加位置DAC中的DefAddressID字段:

public partial class Location : PX.Data.IBqlTable, IPaymentTypeDetailMaster, ILocation
{
    ...
    public abstract class defAddressID : IBqlField { }
    [PXDBInt()]
    [PXDBChildIdentity(typeof(Address.addressID))]
    [PXUIField(DisplayName = "Default Address", Visibility = PXUIVisibility.Invisible)]
    [PXSelector(typeof(Search<Address.addressID>), DirtyRead = true)]
    public virtual int? DefAddressID { get; set; }
    ...
}
公共部分类位置:PX.Data.IBqlTable,IPaymentTypeDetailMaster,ILocation
{
...
公共抽象类defAddressID:IBqlField{}
[PXDBInt()]
[PXDBChildIdentity(typeof(Address.addressID))]
[PXUIField(DisplayName=“Default Address”,Visibility=PXUIVisibility.Invisible)]
[PXSelector(typeof(Search),DirtyRead=true)]
公共虚拟int?DefAddressID{get;set;}
...
}
以下代码片段中的CustomerLocationDAC可以作为自定义DAC的完美示例,用于将客户位置添加到全文实体索引中:

[Serializable]
[PXCacheName("Customer Location")]
[PXBreakInheritance]
public partial class CustomerLocation : SelectedCustomerLocation
{
    public new abstract class bAccountID : IBqlField { }

    [Customer(typeof(Search<Customer.bAccountID,
        Where<Customer.type, Equal<BAccountType.customerType>,
            Or<Customer.type, Equal<BAccountType.prospectType>,
            Or<Customer.type, Equal<BAccountType.combinedType>>>>>),
        IsKey = true)]
    public override int? BAccountID { get; set; }

    public new abstract class locationCD : IBqlField { }

    public new abstract class descr : IBqlField { }

    public new abstract class defAddressID : IBqlField { }

    public new abstract class locType : IBqlField { }

    public new abstract class noteID : IBqlField { }

    [PXNote()]
    [PXSearchable(SM.SearchCategory.CR, "{1} {2}: {3}",
        new Type[] {
            typeof(CustomerLocation.bAccountID),
            typeof(Customer.acctCD),
            typeof(CustomerLocation.locationCD),
            typeof(CustomerLocation.descr) },
        new Type[] {
            typeof(CustomerLocation.bAccountID),
            typeof(Customer.acctCD),
            typeof(CustomerLocation.locationCD),
            typeof(CustomerLocation.descr),
            typeof(CustomerLocation.defAddressID),
            typeof(Address.addressLine1),
            typeof(Address.addressLine2),
            typeof(Address.city),
            typeof(Address.countryID) },
        Line1Format = "{0} {2}",
        Line1Fields = new Type[] {
            typeof(CustomerLocation.descr),
            typeof(CustomerLocation.defAddressID),
            typeof(Address.addressLine1) },
        Line2Format = "{1}",
        Line2Fields = new Type[] {
            typeof(CustomerLocation.defAddressID),
            typeof(Address.addressLine2) },
        WhereConstraint = 
            typeof(Where<CustomerLocation.locType, Equal<LocTypeList.customerLoc>,
                Or<CustomerLocation.locType, Equal<LocTypeList.combinedLoc>>>),
        MatchWithJoin = typeof(InnerJoin<Customer, 
            On<Customer.bAccountID, Equal<CustomerLocation.bAccountID>>>),
        SelectForFastIndexing = typeof(Select2<CustomerLocation, 
            InnerJoin<Customer, 
                On<CustomerLocation.bAccountID, Equal<Customer.bAccountID>>>>)
    )]
    public override Guid? NoteID { get; set; }
}
[可序列化]
[PXCacheName(“客户位置”)]
[遗传]
公共部分类CustomerLocation:SelectedCustomerLocation
{
公共新抽象类bAccountID:IBqlField{}
[客户(类型)(搜索),
IsKey=true)]
公共覆盖int?BAccountID{get;set;}
公共新抽象类locationCD:IBqlField{}
公共新抽象类descr:IBqlField{}
公共新抽象类defAddressID:IBqlField{}
公共新抽象类locType:IBqlField{}
公共新抽象类noteID:IBqlField{}
[PXNote()]
[PXSearchable(SM.SearchCategory.CR,“{1}{2}:{3}”,
新类型[]{
类型(CustomerLocation.bAccountID),
类型(客户账户),
类型(CustomerLocation.locationCD),
typeof(CustomerLocation.descr)},
新类型[]{
类型(CustomerLocation.bAccountID),
类型(客户账户),
类型(CustomerLocation.locationCD),
类型(CustomerLocation.descr),
类型(CustomerLocation.defAddressID),
类型(地址:addressLine1),
类型(地址:addressLine2),
类型(地址、城市),
typeof(Address.countryID)},
Line1Format=“{0}{2}”,
Line1Fields=新类型[]{
类型(CustomerLocation.descr),
类型(CustomerLocation.defAddressID),
类型(Address.addressLine1)},
Line2Format=“{1}”,
Line2Fields=新类型[]{
类型(CustomerLocation.defAddressID),
类型(Address.addressLine2)},
其中约束=
类型(其中),
MatchWithJoin=typeof(InnerJoin),
SelectForFastIndexing=typeof(Select2)
)]
公共覆盖Guid?NoteID{get;set;}
}

由于DefAddressID字段用于包含从地址DAC到全文实体索引的字段,因此CustomerLocation还利用BAccountID字段所附的CustomerAttribute来包含客户的自然应用程序trong>键而不是代理数据库级别BAccountID键。最后要提到的是PXBreakInheritanceAttribute所需,以防止在启用重建全文实体索引屏幕时初始化与基本DAC相对应的PXCache对象。系统生成要使用的实体列表全文实体索引。

PXBreakInheritation的用途是什么?还有一个问题,为什么不使用PXCacheExtension而使用分部类?