Skip to main content
Solved

Columns in my custom grid not automatically added to the UI

  • 21 September 2023
  • 4 replies
  • 271 views

Joe Schmucker
Captain II
Forum|alt.badge.img+3

When I publish my customization, several fields do not show in the grid by default.  I want all columns in my grid showing by default.  When the customer publishes the package, I don’t want them to have to open the screen and manually add the columns to the grid.

 

This is the list of columns in the project editor.

Is there some setting that is making the three fields on the left not be included by default on the right?  I don’t see any options in the editor that would seem to handle this.

 

Best answer by Naveen Boga

Hi @Joe Schmucker In the DAC level, if we mention Visible =false then those will not be shown in the grid and will be available under the Column Configuration.

Remove this property from you DAC then it will be added to your grid by default.

 

View original
Did this topic help you find an answer to your question?

4 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • Answer
  • September 22, 2023

Hi @Joe Schmucker In the DAC level, if we mention Visible =false then those will not be shown in the grid and will be available under the Column Configuration.

Remove this property from you DAC then it will be added to your grid by default.

 


Joe Schmucker
Captain II
Forum|alt.badge.img+3
  • Author
  • Captain II
  • 443 replies
  • September 22, 2023

@Naveen Boga I am using a PXProjection based on SOLine,  Those three fields are from the SOLine DAC and I would guess that they are set to not visible in the original DAC.

I wanted to get the Order Number to show up in my processing results dialog, so I added “MyOrderNumber” to my projection.  If I did not specifically put the field in my Projection, it would not show in the results dialog.  In order to keep from getting the error that my declaration is hiding another, I called the field “MyOrderNumber”.  

 

 

The other way I found is to use an extension on my graph.  Seems kind of clunky to do it this way though, but it is easier than redefining the entire field with the selectors etc.

    // Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
    [PXNonInstantiatedExtension]
    public sealed class SO_SOLine_ExistingColumn : PXCacheExtension<PX.Objects.SO.SOLine>
    {
        #region InventoryID  
        [PXMergeAttributes(Method = MergeMethod.Append)]
        [PXUIField(DisplayName = "Inventory ID", Visible = true)]
        public int? InventoryID { get; set; }
        #endregion
    }

 

This extension fixed the issue.  


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • September 23, 2023

@Joe Schmucker  Yes, this approach will suffice. However, I would recommend utilizing the Cache Attached event instead of extending the DAC to add the same field. By doing so, you future-proof your code in case there are any modifications to the base field in upcoming versions. Using the Cache Attached event as shown below can help you avoid the need for rework

 

  public class SOOrderEntry_Extension : PXGraphExtension<SOOrderEntry>
    {
        [PXMergeAttributes(Method = MergeMethod.Merge)]
        [PXRemoveBaseAttribute(typeof(PXUIFieldAttribute))]
        [PXUIField(DisplayName = "Order Nbr.", Visible = true, Enabled = false)]
        protected virtual void _(Events.CacheAttached<SOLine.orderNbr> e) { }
    }

 


Joe Schmucker
Captain II
Forum|alt.badge.img+3
  • Author
  • Captain II
  • 443 replies
  • September 23, 2023

Thanks @Naveen Boga.  There are a bunch of ways to do things in Acumatica.  I always appreciate learning the best practices.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings