Skip to main content
Question

Curious about this design decision in CustomerMaint.cs

  • September 2, 2021
  • 0 replies
  • 46 views

Forum|alt.badge.img+7

In CustomerMaint.cs the Customer_RowInserted method uses a boolean needUpdate to decide if the cache is going to be updated.  I’m curious to know why it doesn’t just call Update regardless.

		protected virtual void Customer_RowInserted(PXCache cache, PXRowInsertedEventArgs e)
{
bool needUpdate = false;
Customer customer = (Customer)e.Row;
if (customer.DefBillAddressID == null)
{
customer.DefBillAddressID = customer.DefAddressID;
needUpdate = true;
}
if (customer.DefBillContactID == null)
{
customer.DefBillContactID = customer.DefContactID;
needUpdate = true;
}

if (needUpdate)
this.BAccountAccessor.Cache.Update(customer);

CustomerClassDefaultInserting();
}