0

I want to rename a column from its Name in DAC at the place it is reference, the ID field is part of DAC while the Name field is reference by the main DAC using Table__Field in the Grid, How that can be renamed, I tried the Below code but it is not working for reference column "ABCOrder.Status" which is link with AMProdItem on ABCOrder.CodeID, Note- rename worked for AMProdItem.StatusID but not for ABCOrder.status

public override void Initialize() {

  PXUIFieldAttribute.SetDisplayName<ABCOrder.status>(Base.ProdOperRecords.Cache,  "QCO Status");
  PXUIFieldAttribute.SetDisplayName<AMProdItem.statusID>(Base.ProdOperRecords.Cache, "Order Status");
}
Shaj
  • 37
  • 7

1 Answers1

0

If I'm understanding your question correctly, then I've had a similiar issue. I had a view in a custom form that joined with SOORder. I needed to rename one of the fields from SOOrder in my grid. See my code below where I use the CacheAttached command. Interestingly, I found that if I didn't create a cache for SOORder with the view in the first line, the cache attached failed.

    public PXSelect<SOOrder, Where<False>> SOorders;

    [PXMergeAttributes(Method = MergeMethod.Append)]
    [PXCustomizeBaseAttribute(typeof(PXUIFieldAttribute), nameof(PXUIFieldAttribute.DisplayName), "Customer Order Nbr.")]
    protected virtual void SOOrder_CustomerOrderNbr_CacheAttached(PXCache sender) { }
Dharman
  • 30,962
  • 25
  • 85
  • 135
Patrick Chen
  • 1,028
  • 1
  • 6
  • 8
  • i checked the following code and it is not working - – Shaj Aug 17 '20 at 09:32
  • in my case CustomerOrderNbr is not the part of SOOrder table but it is linked with Customer table that has CustomerID as reference to SOOrder now I need to change the name of column. I tried code suggested by you .. but no luck – Shaj Aug 17 '20 at 09:41
  • HI, It worked .. I have to defined the following code for it - 1. Defined a View for the table which has the column in the Graph where u want to Override it. 2. In Initialize Event - PXUIFieldAttribute.SetDisplayName(View.Cache, "New Status"); Basically the key is - Defined the View for the table which has column, and use that view in step 2. – Shaj Aug 17 '20 at 11:54