Reigner Ouano
Reigner Ouano

Reputation: 135

How to get values from PXselector

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

Upvotes: 0

Views: 1107

Answers (1)

Vardan Vardanyan
Vardan Vardanyan

Reputation: 669

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);
        }
    }
}

Upvotes: 1

Related Questions