Skip to main content
Solved

Checkbox FieldUpdated event does not work correctly


I have 4 checkboxes and if I select any the others must be deselected. I'm using each one's FieldUpdate property, but it only works with Internal Budget with Vendor # 1, # 2, # 3 and # 4 not working.
I show an example of how I am using the Field Updated event.

InternalBudget FieldUpdated

Vendor_1 FieldUpdated

 

Enable commit changes property for each field but only works with InternalBudget. Anyone who can help me please?

Best answer by eddiedaco

Thanks @Naveen B for the answer. I resolve the problem using the new event declaration.

 

    protected void _(Events.FieldUpdated<CEBidLeveling, CEBidLeveling.internalBudgetChecked> e)
    {
      var row = (CEBidLeveling)e.Row;
  
      if(row.InternalBudgetChecked==true)
      {
        row.Vendor_1Checked =false;
        row.Vendor_2Checked = false;
        row.Vendor_3Checked = false;
        row.Vendor_4Checked = false;
      }
    }

and set the commit changes property = true.

 

for some reason my acumatica version doesnt recognize the normal event declaration.

View original
Did this topic help you find an answer to your question?

2 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3412 replies
  • June 20, 2021

Hi @eddiedaco 

Below is the sample code for…..If we select one checkbox to deselect the other selected automatically… 

 

  protected virtual void SOOrder_Checkbox1_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
        {
            SOOrder row = e.Row as SOOrder;
            if (row != null)
            {
                SOOrderExt rowExt = row.GetExtension<SOOrderExt>();
                if (rowExt.Checkbox1 == true)
                {
                    rowExt.Checkbox2 = false;
					rowExt.Checkbox3 = false;
					rowExt.Checkbox4 = false;
                }
            }
        }

        protected virtual void SOOrder_Checkbox2_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
        {
            SOOrder row = e.Row as SOOrder;
            if (row != null)
            {
                SOOrderExt rowExt = row.GetExtension<SOOrderExt>();
                if (rowExt.Checkbox2 == true)
                {
                    rowExt.Checkbox1 = false;
					rowExt.Checkbox3 = false;
					rowExt.Checkbox4 = false;
                }
            }
        }
		protected virtual void SOOrder_Checkbox3_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
        {
            SOOrder row = e.Row as SOOrder;
            if (row != null)
            {
                SOOrderExt rowExt = row.GetExtension<SOOrderExt>();
                if (rowExt.Checkbox3 == true)
                {
                    rowExt.Checkbox1 = false;
					rowExt.Checkbox2 = false;
					rowExt.Checkbox4 = false;
                }
            }
        }
		protected virtual void SOOrder_Checkbox4_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
        {
            SOOrder row = e.Row as SOOrder;
            if (row != null)
            {
                SOOrderExt rowExt = row.GetExtension<SOOrderExt>();
                if (rowExt.Checkbox4 == true)
                {
                    rowExt.Checkbox1 = false;
					rowExt.Checkbox2 = false;
					rowExt.Checkbox3 = false;
                }
            }
        }


  • Author
  • Varsity I
  • 32 replies
  • Answer
  • June 20, 2021

Thanks @Naveen B for the answer. I resolve the problem using the new event declaration.

 

    protected void _(Events.FieldUpdated<CEBidLeveling, CEBidLeveling.internalBudgetChecked> e)
    {
      var row = (CEBidLeveling)e.Row;
  
      if(row.InternalBudgetChecked==true)
      {
        row.Vendor_1Checked =false;
        row.Vendor_2Checked = false;
        row.Vendor_3Checked = false;
        row.Vendor_4Checked = false;
      }
    }

and set the commit changes property = true.

 

for some reason my acumatica version doesnt recognize the normal event declaration.


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