Skip to main content
Solved

Multi-Select Combo Box Functionality Not Working


Forum|alt.badge.img+2

I have created attributes on the attributes form below

And these values should be shown as multi-select in Sales Order Line in a user defined field, code is below for getting those values, but in the field it only shows combo box (one value selection).

public class SOOrderEntry_Extension : PXGraphExtension<SOOrderEntry>
  {
    #region Event Handlers
    protected void SOLine_UsrAccessories_FieldSelecting(PXCache cache, PXFieldSelectingEventArgs e)
    {

     List<string> allowedValues = new List<string>();
     List<string> allowedLabels = new List<string>();

            foreach (CSAttributeDetail objCSAttributeDetail in PXSelect<CSAttributeDetail,
                                                      Where<CSAttributeDetail.attributeID, Equal<Required<CSAttributeDetail.attributeID>>>>.Select(Base, "ACCITEMS"))


            {
                allowedValues.Add(objCSAttributeDetail.ValueID);
                allowedLabels.Add(objCSAttributeDetail.Description);
            }

            e.ReturnState = PXStringState.CreateInstance(e.ReturnState, 10, true, typeof(SOLineExt.usrAccessories).Name, false, -1, string.Empty, allowedValues.ToArray(), allowedLabels.ToArray(), false, null);



    }

 

Best answer by Naveen Boga

Hi @TharidhiP  Please find the code for getting multi combo checkbox..

public class SOOrderEntry_Extension : PXGraphExtension<SOOrderEntry>
  {
    #region Event Handlers
    protected void SOLine_UsrAccessories_FieldSelecting(PXCache cache, PXFieldSelectingEventArgs e)
    {

     List<string> allowedValues = new List<string>();
     List<string> allowedLabels = new List<string>();

            foreach (CSAttributeDetail objCSAttributeDetail in PXSelect<CSAttributeDetail,
                                                      Where<CSAttributeDetail.attributeID, Equal<Required<CSAttributeDetail.attributeID>>>>.Select(Base, "ACCITEMS"))


            {
                allowedValues.Add(objCSAttributeDetail.ValueID);
                allowedLabels.Add(objCSAttributeDetail.Description);
            }

            e.ReturnState = PXStringState.CreateInstance(e.ReturnState, 10, true, typeof(SOLineExt.usrAccessories).Name, false, -1, string.Empty, allowedValues.ToArray(), allowedLabels.ToArray(), false, null);

((PXStringState)e.ReturnState).MultiSelect = true;

    }

View original
Did this topic help you find an answer to your question?

3 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3385 replies
  • Answer
  • July 20, 2021

Hi @TharidhiP  Please find the code for getting multi combo checkbox..

public class SOOrderEntry_Extension : PXGraphExtension<SOOrderEntry>
  {
    #region Event Handlers
    protected void SOLine_UsrAccessories_FieldSelecting(PXCache cache, PXFieldSelectingEventArgs e)
    {

     List<string> allowedValues = new List<string>();
     List<string> allowedLabels = new List<string>();

            foreach (CSAttributeDetail objCSAttributeDetail in PXSelect<CSAttributeDetail,
                                                      Where<CSAttributeDetail.attributeID, Equal<Required<CSAttributeDetail.attributeID>>>>.Select(Base, "ACCITEMS"))


            {
                allowedValues.Add(objCSAttributeDetail.ValueID);
                allowedLabels.Add(objCSAttributeDetail.Description);
            }

            e.ReturnState = PXStringState.CreateInstance(e.ReturnState, 10, true, typeof(SOLineExt.usrAccessories).Name, false, -1, string.Empty, allowedValues.ToArray(), allowedLabels.ToArray(), false, null);

((PXStringState)e.ReturnState).MultiSelect = true;

    }


Forum|alt.badge.img+2
  • Author
  • Semi-Pro III
  • 101 replies
  • July 20, 2021

Hi @Naveen B , thank you for your support, will try this out and see.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3385 replies
  • July 20, 2021

Sure @TharidhiP  Let me know if you get any issues.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings