Solved

How to show/Hide a section of a form based on another form field (Check box) value?

  • 7 December 2021
  • 5 replies
  • 522 views

Userlevel 4
Badge +1

Hi, I am new to Acumatica, I want to show or hide some section based on the check box value which is available in another form. How to achieve this functionality. Could you please assist on this.

icon

Best answer by vivekm 7 December 2021, 11:43

View original

5 replies

Userlevel 4
Badge

Hi @MoulaliShaik79 

You can try like below using RowSelected event:

 protected virtual void InventoryItem_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected BaseEvent)
        {
            if (BaseEvent != null) BaseEvent(cache, e);
            InventoryItem rows = (InventoryItem)e.Row;
            if (rows == null) return;
            if (rows.checkbox == false) // If your checkbox unchecked
            {
                View.AllowSelect = false; // whole section will be hidden, if that section has specific view
                PXUIFieldAttribute.SetVisible<KNDCInventoryItemExt.usrKNDCBaseNewConditionSKU>(cache, rows, false); // specific field will be hidden
            }
        }

Userlevel 7
Badge +17

Hi @MoulaliShaik79  Please find the code sample below.

 

  protected virtual void DACName_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
{
InvokeBaseHandler?.Invoke(cache, e);
DACName row = e.Row as DACName;
if (row != null)
{
if (row.Checkboxvalue == true)
{
ViewName.AllowSelect = false;
}
else
{
ViewName.AllowSelect = true;
}
}
}

 

Userlevel 4
Badge +1

Thanks a lot both of you.

Userlevel 7
Badge +17

@MoulaliShaik79  Hope you have done with your requirement

Userlevel 4
Badge +1

@MoulaliShaik79  Hope you have done with your requirement

@Naveen B, Yes, I did it.

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