Skip to main content
Answer

Multi-Select Combo Box Functionality Not Working

  • July 20, 2021
  • 3 replies
  • 499 views

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;

}

3 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 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
  • Pro III
  • 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
  • July 20, 2021

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