【发布时间】:2021-12-17 23:28:50
【问题描述】:
美好的一天
我为销售订单的客户 ID 属性创建了一个自定义属性。 使用客户 ID 的当前属性,处于信用保留状态的客户不会显示在列表中。
我的想法是动态更改列表,以便如果订单类型是 QT 客户,则处于信用保留状态的客户仍会显示在列表中。
我的问题是我不知道是否有办法发送/获取当前的 SOOrder.OrderType
这就是我所在的地方
namespace PX.Objects.SO
{
[PXNonInstantiatedExtension]
public class SO_SOOrder_ExistingColumn : PXCacheExtension<PX.Objects.SO.SOOrder>
{
#region CustomerID
[PXMergeAttributes(Method = MergeMethod.Append)]
// [CustomercustomersAttribute(Current<SOOrder.orderType>))]
[CustomercustomersAttribute()]
public int? CustomerID { get; set; }
#endregion
}
public class CustomercustomersAttribute : PXCustomSelectorAttribute
{
public string orderType { get; set; }
public Type orderType2 { get; set; }
public CustomercustomersAttribute(Type OrderType) : base(typeof(Customer.acctCD))
{
this.orderType2 = OrderType;
this.DescriptionField = typeof(Customer.acctName);
}
public CustomercustomersAttribute(string OrderType) : base(typeof(Customer.acctCD))
{
this.orderType = OrderType;
this.DescriptionField = typeof(Customer.acctName);
}
public CustomercustomersAttribute() : base(typeof(Customer.acctCD))
{
this.DescriptionField = typeof(Customer.acctName);
}
protected virtual IEnumerable GetRecords()
{
foreach (Customer pc in PXSelect<Customer>.Select(this._Graph))
{
if (pc.Status != "A")
{
// Here I want to do the check if
if (orderType.ToString() == "QT")
{
yield return pc;
}
}
else
{
yield return pc;
}
}
}
}
}
【问题讨论】:
标签: acumatica