Example #1
0
        protected virtual void ARPriceClass_RowDeleting(PXCache sender, PXRowDeletingEventArgs e)
        {
            ARPriceClass row = e.Row as ARPriceClass;

            if (row != null)
            {
                PXSelectorAttribute.CheckAndRaiseForeignKeyException(sender, e.Row, typeof(DiscountCustomerPriceClass.customerPriceClassID));

                /* TODO: add customer(location) ref. */
            }
        }
Example #2
0
        protected virtual void ARPriceClass_CustPriceClassID_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
        {
            ARPriceClass row = e.Row as ARPriceClass;

            if (row != null)
            {
                if (ARPriceClass.EmptyPriceClass == e.NewValue.ToString())
                {
                    e.Cancel = true;
                    if (sender.RaiseExceptionHandling <ARPriceClass.priceClassID>(e.Row, null, new PXSetPropertyException(Messages.ReservedWord, ARPriceClass.EmptyPriceClass)))
                    {
                        throw new PXSetPropertyException(typeof(ARPriceClass.priceClassID).Name, null, Messages.ReservedWord, ARPriceClass.EmptyPriceClass);
                    }
                }
            }
        }