How to add list values to drop down in Acumatica

Hello everybody,

today I want to make quick notice of how to make drop down values in Acumatica avalable. 

Let's imagine, that you need following drow down list:

In order to get this kind of list, you can use the following code:

public static class JiraAccountStatusEnum
      public const string Open = "O";
      public const string Closed = "C";
      public const string Archived = "A";

public class JiraAccountListAttribute : PXStringListAttribute
   public JiraAccountListAttribute() : base(
            new string[] {JiraAccountStatusEnum.Open, JiraAccountStatusEnum.Closed, 
JiraAccountStatusEnum.Archived}, new string[] {"Open", "Closed", "Archived"}) { } }

2. In your DAC member class write the following:

#region UsrStatus
public abstract class usrStatus : IBqlField

protected string _UsrStatus;
[PXUIField(DisplayName = "Status")]
public virtual string UsrStatus
        return _UsrStatus;
        _UsrStatus = value;

3. Finally in your aspx page use the following control:

<px:PXDropDown ID="pxddUsrStatus" runat="server" DataField="UsrStatus"></px:PXDropDown>

That's it what is needed. If you follow steps, mentioned in this notice, you'll get drop down, screenshot of which you've seen.

Add comment