Skip to main content
Question

Curious about this design decision in CustomerMaint.cs

  • September 2, 2021
  • 0 replies
  • 42 views

Forum|alt.badge.img+6

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

 

0 replies

Be the first to reply!

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