Skip to main content
Solved

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

  • December 7, 2021
  • 5 replies
  • 726 views
  • Translate All

Forum|alt.badge.img+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.

Best answer by vivekm

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

View original

5 replies

vivekm
Varsity III
Forum|alt.badge.img
  • Varsity III
  • Answer
  • December 7, 2021

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

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20

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;
}
}
}

 

Translate

Forum|alt.badge.img+1

Thanks a lot both of you.

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20

@MoulaliShaik79  Hope you have done with your requirement

Translate

Forum|alt.badge.img+1

@MoulaliShaik79  Hope you have done with your requirement

@Naveen B, Yes, I did it.

Translate