Solved

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

  • 23 February 2021
  • 5 replies
  • 52 views

Userlevel 4
Badge

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 B 24 February 2021, 02:52

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!!

View original

5 replies

Userlevel 5
Badge +3

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 4
Badge

@Naveen B  Hello Captain,

         Where is the “Smart Panel” you talked about.

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

 

Userlevel 5
Badge +3

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 4
Badge

@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 5
Badge +3

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