I have a table that holds a text value of the GL account code from an import. On the Grid in the form, I want to display a Account Selector on the same view that is defaulted to the GL account code from the text field.
The PXSelector for AccountID is an unbound field.
Here are the two fields from the DAC
#region AccountID
[PXInt()]
[PXUnboundDefault]
[PXUIField(DisplayName = "Account")]
[PXSelector(typeof(Search<Account.accountID>),
typeof(Account.accountID),
typeof(Account.description),
SubstituteKey = typeof(Account.accountCD),
DescriptionField = typeof(Account.description))]
public virtual Int32? AccountID { get; set; }
public abstract class accountID : PX.Data.BQL.BqlInt.Field<accountID> { }
#endregion
#region AccountCD
[PXDBString(10, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Account CD")]
public virtual string AccountCD { get; set; }
public abstract class accountCD : PX.Data.BQL.BqlString.Field<accountCD> { }
#endregion
I could probably set the value of the AccountID field in the RowSelected event but I know that is a no-no.
I tried using the Search string get it’s value from the AccountCD field but it only restricts the lookup to that GL account.
The Selector works fine on the Grid and you can select an account. I just want it set to whatever the respective AccountCD value is.
Anyone have a trick to do this?