Question

How to - Filter the categories on BigCommerce Store screen of Default Stock Categories field

  • 19 September 2023
  • 0 replies
  • 21 views

Hi Team,

We are working with BigCommerce connector (build: 23.105). In BigCommerce Stores screen under inventory setting tab, we have Default Stock Categories field (Dropdown field) it loads all item sales categories by default. I want to override this field to load only required categories. We tried with fieldSelecting event but values are not updating in the Default Stock Categories field. Can you please review below details and suggest the best possible way to do that.

 

Graph:

   public class KNBCROBCBigCommerceStoreMaintExt : PXGraphExtension<BCBigCommerceStoreMaint>
    {
        public static bool IsActive() { return true; }
        protected virtual void BCBindingExt_StockSalesCategoriesIDs_FieldSelecting(PXCache cache, PXFieldSelectingEventArgs e)

        {
            BCBindingExt row = e.Row as BCBindingExt;
            BCBinding bCBinding = PXSelect<BCBinding, Where<BCBinding.bindingID, Equal<Required<BCBinding.bindingID>>>>.Select(Base, row?.BindingID);
                List<string> allowedValues = new List<string>();
                List<string> allowedLabels = new List<string>();

                INCategory category = PXSelect<INCategory, Where<INCategory.description, Equal<Required<INCategory.description>>>>.Select(Base, bCBinding?.BindingName);
                foreach (INCategory categories in PXSelect<INCategory, Where<INCategory.parentID, Equal<Required<INCategory.parentID>>>>.Select(Base, category?.CategoryID))
                {
                    allowedValues.Add(categories.CategoryID.ToString());
                    allowedLabels.Add(categories.Description.Trim());
                }
                e.ReturnState = PXStringState.CreateInstance(e.ReturnState, 4000, true, typeof(BCBindingExt.stockSalesCategoriesIDs).Name, false, -1, string.Empty, allowedValues.ToArray(), allowedLabels.ToArray(), true, null);
                ((PXStringState)e.ReturnState).MultiSelect = true;
            
        }

    }

Thank you in Advance!
 


0 replies

Be the first to reply!

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