Solved

Help needed when adding a column on "Add stock item" pop up window of SO entry screen.

  • 23 February 2021
  • 5 replies
  • 331 views

Userlevel 6
Badge +5

Hello,

    We are having a customized field on Stock Item called “Temperature zone”, which means where shall the item be stocked, dry area, frozen area, or cooler area.

     I can make this field appear on SOline using a simple customization.

     The key code is   

InventoryItemExt rowExt = PXCache<InventoryItem>.GetExtension<InventoryItemExt>(item);
switch (rowExt.UsrTempZone)
{
case 0: cache.SetValue<SOLineExt.usrTempZone>(row, "Dry"); break;
case 1: cache.SetValue<SOLineExt.usrTempZone>(row, "Fresh"); break;
case 2: cache.SetValue<SOLineExt.usrTempZone>(row, "Frozen"); break;
}

   

   However, if I want to add this field in the “Inventory lookup window”, which is poped up by clicking “add stock item”, the same method does not work.

 

     I was stucked even in the first step, after I have added the field in UI, I can not find the data class.

 

icon

Best answer by Naveen Boga 24 February 2021, 02:52

View original

5 replies

Userlevel 7
Badge +17

Hi @ray20 ,

 

Have you added the “Temp Zone” field in the so301000.aspx page under the Inventory Lookup smart panel?

 

I have worked on similar functionality in the past like “InventoryItem” DAC extended fields added to the “Inventory Lookup” popup window and showing the fields as expected. Please find the screenshot for reference.

 

 

 

 

Userlevel 6
Badge +5

@Naveen B  Hello Captain,

         Where is the “Smart Panel” you talked about.

I added the filed in the below area, is it correct?

 

Userlevel 7
Badge +17

Hello @ray20 

Forgot to mention the below point..

 

Whatever the fields we wanted to display in the Inventory Lookup grid, we need to extend the SOSiteStatusSelected DAC by referring to the InventoryItem extended DAC fields.

 

Please fidn the code and screenshot for reference.

 

 public class SOSiteStatusSelectedExt : PXCacheExtension<PX.Objects.SO.SOSiteStatusSelected>
{
#region DACField1

[PXDBString(255, IsUnicode = true, BqlField = typeof(InventoryItemExt.DACField1))]
[PXUIField(DisplayName = "Field Name")]
public virtual string DACField1 {get; set;}
public abstract class dACField1 : BqlString.Field<dACField1> { }


#endregion
}

 

 

Hope this helps!!

Userlevel 6
Badge +5

@Naveen B 
Hello Captain, Mission completed.

The
BqlField = typeof(InventoryItemExt.DACField1)
is amazing, why I did not know it before.

By the way,  I encountered the “ the type or namespace name 'bqlfield' could not be found” issue at the beginning, it might be I tried to use Nonpersisting field
If I changed to DBfield, this error disappeared

 

So my large guess is Nonpersisting field did not support BqlField method, while DB field can support.

Below is my working code, note Acumatica would perfectly translate 0 (saved in DB) to “Dry” in the UI

It is great.

[PXDBInt(BqlField = typeof(InventoryItemExt.usrTempZone))]
[PXUIField(DisplayName="Temp Zone")]
[PXIntList(new int[]{0,1,2}, new string[]{"Dry", "Fresh", "Frozen"})]

 

Userlevel 7
Badge +17

Hi, @ray20  hahaha :D

Thanks a lot for the update. :)

Yes, you are right. In this case, we need to use the “Bound/Persisting” fields. 

 

 

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 — 2024  Acumatica, Inc. All rights reserved