3

I have the following use case:

Acumatica combo box / dropdown, which can have 8 or so values, the selection of which determines the table / DAC used to present in a Combo box/ drop down.

e.g.:

  • if current StatusProfileID = WO1 and Status = WCMP , WCMP is Current UserStatus, then UserStatus = WRJT, WEXE,WCMP
  • if current StatusProfileID = WO1 and Status = WRJT , WRJT is Current UserStatus, then UserStatus = WEXE, WRJT

How can I make the user status that appears in accordance with the current status, and will change in real time while selecting another data

I follow the way of Acumatica Dynamic MultiSelect Dropdown to select data from status table

I understand that I'd have to use a Custom StringList Attribute, but the details of how to do this are not clear.

Screen Drop Down List

Data from table status

Community
  • 1
  • 1

2 Answers2

2

one way of dynamically changing the stringlist is by the below sample code in a proper rowselected event

if(somecondition)
 PXStringListAttribute.SetList<DAC.Field>(sender, row,
                    new string[] { "WRJT", "WEXE", "WCMP" },
                    new string[] { "WRJT", "WEXE", "WCMP" });
else
 PXStringListAttribute.SetList<DAC.Field>(sender, row,
                    new string[] { "WEXE", "WRJT" },
                    new string[] { "WEXE", "WRJT" });
Sin
  • 1,836
  • 2
  • 17
  • 24
1

Just want to extend the answer with sample of RowSelected, but with new syntax, and applicable for PXIntList:

protected virtual void _(Events.RowSelected<CROpportunity> e)
{
 if (e.Row == null)
     return;
 var opportunityExtension = e.Row.GetExtension<CROpportunityExt>();

 if (opportunityExtension.UsrProduct == 0)
 {
     var listInts = new List<int>();
     var listStrings = new List<String>();

     listInts.Add(0);
     listInts.Add(1);
     listInts.Add(2);

     listStrings.Add("String 1");
     listStrings.Add("String 2");
     listStrings.Add("String 3");

     PXIntListAttribute.SetList<CROpportunityExt.usrProposition>(e.Cache, e.Row, listInts.ToArray(), listStrings.ToArray());
 }

 if (opportunityExtension.UsrProduct == 1)
 {
     var listInts = new List<int>();
     var listStrings = new List<String>();

     listInts.Add(0);
     listInts.Add(3);
     listInts.Add(5);

     listStrings.Add("String 2");
     listStrings.Add("String 3");
     listStrings.Add("String 4");

     PXIntListAttribute.SetList<CROpportunityExt.usrProposition>(e.Cache, e.Row, listInts.ToArray(), listStrings.ToArray());
 }
}
Yuriy Zaletskyy
  • 4,983
  • 5
  • 34
  • 54