Loading ...

Hos 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:

 

dropdownValues.png
drop down values

 

 

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")]
[PXDBString(10)]
[JiraAccountList]
public virtual string UsrStatus
{
   get
      {
        return _UsrStatus;
      }
   set
      {
        _UsrStatus = value;
      }
}
#endregion

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.

Ready to take your Acumatica customization to the next level? Whether you need help implementing drop-down lists like the one in this example or have a unique customization request, our team is here to help! Share your ideas with us, and let’s build solutions tailored to your business needs.

Leave a customization request today and let’s transform your Acumatica experience together!