Solved

Inventory Item Search truncates description in 2021 R2

  • 29 September 2021
  • 5 replies
  • 60 views

Userlevel 1
Badge

I added a bunch of items via the REST API to Stock Items. I then did an update on the description of those Stock Items (generally the description was longer than the original) also using the REST API.

 

In the search for Stock Items, the items appear with the correct description. However in Inventory Item search launched from a Sales Order, when I search for these same items, the Description is truncated.

 

Does anyone know why I am seeing this discrepancy? Is there something about the Inventory Stock Item search launched from a Sales Order that caches the description independent of the search available on the Stock Items screen?

icon

Best answer by rosenjon 21 October 2021, 21:08

View original

5 replies

Userlevel 1
Badge

This looks to be a UI display bug, as I’ve played around with the system more. The fields aren’t actually truncated, but if the Add Items dialog is sized in a certain way, it makes it appear that way.

Userlevel 1
Badge

I remember this being a problem years ago when I first started playing with Acumatica. I figured out how to fix it by subclassing SOOrderEntry.cs in an extension library. You can then override the hardcoded length of the Description field for the PXProjection, which is set to 60 characters...that’s what the 60 in this line does:

        [PXDBLocalizableString(60, IsUnicode = true, BqlField = typeof(InventoryItem.descr), IsProjection = true)]
 

Maybe there is some other, more clever way to fix this in the customization project editor. However, if this is the only way to do this, I would suggest making this a configurable value and not hard coding it into the PXProjection. Many people have item descriptions longer than 60 characters, and this basically presents as a bug unless you are a developer...

 

        #region Descr
        public abstract class descr : PX.Data.BQL.BqlString.Field<descr> { }

        protected string _Descr;
        [PXDBLocalizableString(60, IsUnicode = true, BqlField = typeof(InventoryItem.descr), IsProjection = true)]
        [PXUIField(DisplayName = "Description", Visibility = PXUIVisibility.SelectorVisible)]
        public virtual String Descr
        {
            get
            {
                return this._Descr;
            }
            set
            {
                this._Descr = value;
            }
        }
        #endregion

Userlevel 3
Badge +1

You can modify the attributes in the customization project editor which for something this simple would likely be a lot easier.

 

Userlevel 1
Badge

Cool, thank you Mark! That is exactly what I was wondering about.

Userlevel 1
Badge

One other comment on this one. I don’t really know why we are truncating the item description at all here? The grid natively sizes to a certain size...and if you expand the grid size, it should show more of the description. What useful purpose is served by artificially constricting the length of this field when it’s displayed in this grid, thus necessitating customization to undo it? Why not just make the length of this field the same size as the max length of the database field?

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2020  Acumatica, Inc. All rights reserved