Skip to main content
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?

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


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