Код: Выделить всё
namespace PX.Objects.SO
{
public class SOOrderEntry_Extension : PXGraphExtension
{
protected void SOOrder_UsrTypeOfOrder_FieldSelecting(PXCache cache, PXFieldSelectingEventArgs e)
{
List allowedValues = new List();
List allowedLabels = new List();
SOOrderEntry graph = (SOOrderEntry)sender.Graph;
var query = PXSelect<
CSAttributeDetail,
Where<
CSAttributeDetail.attributeID,
Equal
>
>.Select(graph, "TOO");
foreach (CSAttributeDetail attrDetail in query)
{
allowedValues.Add(attrDetail.ValueID);
allowedLabels.Add(attrDetail.Description);
}
e.ReturnState = PXStringState.CreateInstance(
e.ReturnState,
50,
true,
typeof(SOOrderExt.usrTypeOfOrder).Name,
false,
-1,
string.Empty,
allowedValues.ToArray(),
allowedLabels.ToArray(),
false,
null
);
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/790 ... d-in-sales