Skip to main content

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.

 

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.

 

 

 

 


@Naveen B  Hello Captain,

         Where is the “Smart Panel” you talked about.

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

 


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


@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.

lPXDBInt(BqlField = typeof(InventoryItemExt.usrTempZone))]
ZPXUIField(DisplayName="Temp Zone")]
ZPXIntList(new intt]{0,1,2}, new string}]{"Dry", "Fresh", "Frozen"})]

 


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