Skip to main content
Solved

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

  • February 23, 2021
  • 5 replies
  • 361 views

Forum|alt.badge.img+5
  • Captain II
  • 398 replies

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.

 

Best answer by Naveen Boga

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
Did this topic help you find an answer to your question?

5 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3404 replies
  • February 23, 2021

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.

 

 

 

 


Forum|alt.badge.img+5
  • Author
  • Captain II
  • 398 replies
  • February 24, 2021

@Naveen B  Hello Captain,

         Where is the “Smart Panel” you talked about.

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

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3404 replies
  • Answer
  • February 24, 2021

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


Forum|alt.badge.img+5
  • Author
  • Captain II
  • 398 replies
  • February 24, 2021

@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"})]

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3404 replies
  • February 24, 2021

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings