Search code examples
fieldrenameacumaticareferential

Acumatica - Rename Referential Grid field


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");
}

Solution

  • 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) { }