Acumatica - Different PXUIField names for the same field in the same graph for different tabs

时间:2018-02-01 18:15:51

标签: c# asp.net acumatica

I have a page containing several tabs, with the common graph. The problem is that I use one particular field in two tabs and what if the customer needs to display them with different names on each tab? Here's my DAC:

    [PXDBString(15, IsUnicode = true)]
    [PXDefault()]
    [PXUIField(DisplayName = "Product Foo")]
    public virtual string ProductFoo
    {
        get
        {
            return this._ProductFoo;
        }
        set
        {
            this._ProductFoo = value;
        }
    }

More particularly, what if I need to name this field not "Product Foo" but "Product Bar" on the second tab?

I can't do it with

protected void Product_ProductFoo_CacheAttached(PXCache sender){}

because as I've already mentioned, they use the common graph.

So is there any solution?

1 个答案:

答案 0 :(得分:0)

You can if you create an additional DAC for each tab data view such as

[Serializable]
public class Product2 : Product 
{
    public new abstract class productFoo: PX.Data.IBqlField
    {
    }
    [PXDBString(15, IsUnicode = true)]
    [PXDefault()]
    [PXUIField(DisplayName = "Product Foo 2")]
    public override string ProductFoo
    {
        get
        {
            return this._ProductFoo;
        }
        set
        {
            this._ProductFoo = value;
        }
    }
}

You would have to update your view to use Product2, Product3, etc. for each addtional DAC class used for each tab.