如何从PXselector获取值

时间:2019-07-16 08:49:46

标签: c# asp.net acumatica

你好,我是Acumatica开发的新手,只想问问我在选择一行时如何从pxselector获取数据

这是我创建的选择器

enter image description here

当我选择一个时,我只会得到atc的值。

但我还需要获取Taxrate的值并将其值放在下一个网格上,即select上的WtaxPercent

enter image description here

这是我的pxselector代码

#region UsrATC
    [PXDBString(10)]
    [PXUIField(DisplayName="ATC")]
    [PXSelector(typeof(Search<withhildingtax.atc>),
                typeof(withhildingtax.Atcdescription),
                typeof(withhildingtax.Taxrate))]
    public virtual string UsrATC { get; set; }
    public abstract class usrATC : PX.Data.BQL.BqlString.Field<usrATC> { }
    #endregion

    #region UsrWTAXPercentage
    [PXDBDecimal]
    [PXUIField(DisplayName="WTaxPercentage")]

    public virtual Decimal? UsrWTAXPercentage { get; set; }
    public abstract class usrWTAXPercentage : PX.Data.BQL.BqlDecimal.Field<usrWTAXPercentage> { }
    #endregion

预先感谢您的帮助

1 个答案:

答案 0 :(得分:0)

public class Test : IBqlTable
{
    #region UsrATC
    [PXDBString(10)]
    [PXUIField(DisplayName = "ATC")]
    [PXSelector(typeof(Search<withhildingtax.atc>),
                typeof(withhildingtax.Atcdescription),
                typeof(withhildingtax.Taxrate))]
    public virtual string UsrATC { get; set; }
    public abstract class usrATC : PX.Data.BQL.BqlString.Field<usrATC> { }
    #endregion

    #region UsrWTAXPercentage
    [PXDBDecimal]
    [PXUIField(DisplayName = "WTaxPercentage")]
    [PXDefault(typeof(Search<withhildingtax.Taxrate, Where<withhildingtax.atc, Equal<Current<Test.usrATC>>>>))]
    [PXSelector(typeof(Search<withhildingtax.Taxrate, Where<withhildingtax.atc, Equal<Current<Test.usrATC>>>>))]
    public virtual Decimal? UsrWTAXPercentage { get; set; }
    public abstract class usrWTAXPercentage : PX.Data.BQL.BqlDecimal.Field<usrWTAXPercentage> { }
    #endregion
}
public class TestGraph : PXGraph<TestGraph>
{
    protected virtual void Test_UsrATC_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
    {
        if (e.Row is Test row)
        {
            sender.SetDefaultExt<Test.usrWTAXPercentage>(e.Row);
        }
    }
}