在 PXSelector 上设置条件以根据另一个 table 的值过滤字段

Set condition on PXSelector to filter fields based on the value from another table

我有一个选择器字段,我试图在该字段中仅显示与选择器中的父文档 NoteID 具有相同 detailNoteID 的子字段。 这些是我正在使用的 2 个领域。底部的线是我想要做的。 Example image

    [PXDBInt()]
    [PXUIField(DisplayName = "Document Type")]
    [PXSelector(typeof(Search<DMDocType.documentID, Where<DMDocType.isActive, Equal <True>>>),
    typeof(DMDocType.documentCD),
    typeof(DMDocType.description),
    ValidateValue = false,
    DescriptionField = typeof(DMDocType.description),
    SubstituteKey = typeof(DMDocType.description))]  
    [PXDefault(PersistingCheck = PXPersistingCheck.NullOrBlank)]      
    public virtual int? DocumentType { get; set; }
    public abstract class documentType : PX.Data.BQL.BqlInt.Field<documentType> { }
    #endregion

    #region DocumentCategory
    [PXDBInt()]
    [PXUIField(DisplayName = "Document Category")]
    [PXSelector(typeof(Search<DMDocCategory.documentID, Where<DMDocCategory.docTypeID, Equal<Current<documentType>>
     , And<DMDocCategory.isActive, Equal <True>>>>),
    typeof(DMDocCategory.description),
    SubstituteKey = typeof(DMDocCategory.description))]       
    public virtual int? DocumentCategory { get; set; }
    public abstract class documentCategory : PX.Data.BQL.BqlInt.Field<documentCategory> { }
     #endregion

This is what I am looking for.

[PXSelector(typeof(Search<DMDocCategory.documentID, Where<DMDocCategory.detailNoteID, Equal<Current<DMDocType.noteID>>

您可以使用 Search2 来连接表。像这样:

[PXSelector(typeof(Search2<DMDocCategory.documentID, InnerJoin<DMDocType, On<DMDocCategory.detailNoteID, Equal<DMDocType.noteID>>>, Where<DMDocType.noteID, Equal<Current<DMDocType.noteID>>>>))]

还有其他变体,例如 Search3、Search4 等,它们为您提供更多选项来排序、汇总等。