Inventory Item Search truncates description in 2021 R2
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?
Page 1 / 1
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.
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;       sPXDBLocalizableString(60, IsUnicode = true, BqlField = typeof(InventoryItem.descr), IsProjection = true)]       sPXUIField(DisplayName = "Description", Visibility = PXUIVisibility.SelectorVisible)]       public virtual String Descr       {          get          {             return this._Descr;          }          set          {             this._Descr = value;          }       }       #endregion
You can modify the attributes in the customization project editor which for something this simple would likely be a lot easier.
Â
Cool, thank you Mark! That is exactly what I was wondering about.
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?