How to get values from PXselector

2019-08-28 01:23发布

Hello I am new in Acumatica development just want to ask how to get the data from pxselector when I select a row

here is my selector that i created

enter image description here

when I select one I only get the value for the atc.

BUT I ALSO NEED TO GET THE VALUE OF THE Taxrate and put the value on the next grid here WtaxPercent on select

enter image description here

here is my code for the 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

Thank you in advance for your help

1条回答
太酷不给撩
2楼-- · 2019-08-28 01:28
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);
        }
    }
}
查看更多
登录 后发表回答