我想在公式主屏幕中为过滤数据带上选择器(公式CD),

时间:2018-06-06 14:09:32

标签: acumatica

FormulaID是身份字段,它是新开发的屏幕,但我无法获得选择器。我已经尝试了所有我知道的方法来实现这一目标:

  1. 维持父母与子女的关系
  2. 使用BQL查询进行数据视图
  3. 以下是来自DAC的FormulaID和FormulaCD的定义:

    #region FormulaID
    public abstract class formulaID : PX.Data.IBqlField
    {
    }
    protected int? _FormulaID;
    
    [PXDBIdentity(IsKey =true)]
    [PXUIField(Enabled = false)]
    public virtual int? FormulaID
    {
        get
        {
            return this._FormulaID;
        }
        set
        {
            this._FormulaID = value;
        }
    #endregion
    
    #region FormulaCD
    public abstract class formulaCD : PX.Data.IBqlField
    {
    }
    protected string _FormulaCD;
    
    [PXDBString(30,IsUnicode = true)]
    [PXUIField(DisplayName = "Formula ID", Visibility = PXUIVisibility.SelectorVisible)]
    [PXSelector(typeof(Search<TSFormula.formulaCD>),
           typeof(TSFormula.descr),SubstituteKey = typeof(TSFormula.formulaCD), ValidateValue = false)]
    public virtual string FormulaCD
    {
        get
        {
            return this._FormulaCD;
        }
        set
        {
            this._FormulaCD = value;
        }
    }
    #endregion
    

1 个答案:

答案 0 :(得分:1)

在下面的示例中,PXDBIdentity整数字段未启用且不可见。使用描述的PXSelector将String字段标记为isKey = true。 ASPX页面标记为String字段提供了px:PXSelector标记,如下所示:

      <px:PXSelector ID="edContractNumber" runat="server" DataField="ContractNumber"
            AutoRefresh="True" DataSourceID="ds" NullText="<NEW>">
            <GridProperties FastFilterFields="ShortName">
                <Columns>
                    <px:PXGridColumn DataField="ContractNumber" Width="90px"></px:PXGridColumn>
                    <px:PXGridColumn DataField="ShortName" Width="120px"></px:PXGridColumn>
                </Columns>
            </GridProperties>
        </px:PXSelector>

以下是DAC字段:

    #region ContractID
    public abstract class contractID : PX.Data.IBqlField
    {
    }
    [PXDBIdentity()]
    [PXDefault(0)]
    [PXUIField(Visible = false, Enabled = false)]
    public virtual int? ContractID
    {
        get;
        set;
    }
    #endregion

    #region ContractNumber
    public abstract class contractNumber : PX.Data.IBqlField
    {
    }
    [PXDBString(IsKey = true)]
    [PXDefault()]
    [PXSelector(typeof(Search3<MyDAC.contractNumber,
                OrderBy<Desc<MyDAC.contractID>>>),
        new Type[] {           
        typeof(MyDAC.shortName),
        typeof(MyDAC.contractNumber)},
        DirtyRead = true)]
    [PXUIField(DisplayName = "Contract Number", Required = true)]
    public virtual string ContractNumber { get; set; }
    #endregion