扩展 PX.Objects.CR.CRMSourcesAttribute

Extending PX.Objects.CR.CRMSourcesAttribute

我正在尝试将条目添加到 CRMSourcesAttribute class,以便在机会下拉框中获得更多选项。

我看到了 PXAttributeExtension,但显然这不适合开发人员,因为我无法为设置实际值的基础 class PXStringListAttribute 提供构造函数。

一定有一种简单的方法可以将条目添加到该下拉框!

您甚至不需要进行任何自定义或编程来更改此列表。通过将屏幕添加到自动化步骤屏幕,您可以将源字段放在自动化定义的字段选项卡中并覆盖组合框值。请注意,如果您尝试使用 Acumatica 5.0,您可能需要从通用查询中删除 "Opportunities" 列表作为入口点,否则它会在您尝试 selection 时干扰 select 自动化步骤中的机会屏幕。

如果您想通过编程实现 - 您需要将字段上的 CRMSourcesAttribute 替换为该属性的您自己的版本。该属性相当简单,仅派生自 PXStringList 属性:

public class CRMSourcesAttribute : PXStringListAttribute
{
    public const string _WEB = "W";
    public const string _PHONE_INQ = "H";
    public const string _REFERRAL = "R";
    public const string _PURCHASED_LIST = "L";
    public const string _OTHER = "O";


    public CRMSourcesAttribute() : 
        base(new[] { _WEB, _PHONE_INQ, _REFERRAL, _PURCHASED_LIST, _OTHER },
                    new[] { Messages.Web, Messages.PhoneInq, Messages.Referral, Messages.PurchasedList, Messages.Other })
    {
    }
}