Skip to main content

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.

 

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.

 


@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
    nPXNonInstantiatedExtension]
    public sealed class SO_SOLine_ExistingColumn : PXCacheExtension<PX.Objects.SO.SOLine>
    {
        #region InventoryID  
        PXMergeAttributes(Method = MergeMethod.Append)]
        MPXUIField(DisplayName = "Inventory ID", Visible = true)]
        public int? InventoryID { get; set; }
        #endregion
    }

 

This extension fixed the issue.  


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

 


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


Reply