protected virtual void INKitSpecNonStkDet_RowPersisting(PXCache sender, PXRowPersistingEventArgs e)
        {
            INKitSpecNonStkDet row = e.Row as INKitSpecNonStkDet;

            if (row == null)
            {
                return;
            }
            if ((e.Operation & PXDBOperation.Command) == PXDBOperation.Delete)
            {
                return;
            }

            PXSelectBase <INKitSpecNonStkDet> select = new PXSelect <INKitSpecNonStkDet,
                                                                     Where <INKitSpecNonStkDet.kitInventoryID, Equal <Current <INKitSpecHdr.kitInventoryID> >,
                                                                            And <INKitSpecNonStkDet.revisionID, Equal <Current <INKitSpecHdr.revisionID> >,
                                                                                 And <INKitSpecNonStkDet.compInventoryID, Equal <Required <INKitSpecStkDet.compInventoryID> > > > > >(this);

            PXResultset <INKitSpecNonStkDet> res = select.Select(row.CompInventoryID);

            if (res.Count > 1)
            {
                InventoryItem item = PXSelect <InventoryItem, Where <InventoryItem.inventoryID, Equal <Required <InventoryItem.inventoryID> > > > .Select(this, row.CompInventoryID);

                if (sender.RaiseExceptionHandling <INKitSpecNonStkDet.compInventoryID>(e.Row, item.InventoryCD, new PXException(Messages.KitItemMustBeUnique)))
                {
                    throw new PXRowPersistingException(typeof(INKitSpecNonStkDet.compInventoryID).Name, item.InventoryCD, Messages.KitItemMustBeUnique);
                }
            }
        }
        protected virtual void INKitSpecNonStkDet_CompInventoryID_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
        {
            INKitSpecNonStkDet row = e.Row as INKitSpecNonStkDet;

            if (row != null)
            {
                InventoryItem item = InventoryItem.PK.Find(this, row.CompInventoryID);
                if (item != null)
                {
                    row.UOM = item.BaseUnit;
                }
            }
        }
        protected virtual void INKitSpecNonStkDet_CompInventoryID_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e)
        {
            INKitSpecNonStkDet row = e.Row as INKitSpecNonStkDet;

            if (row != null)
            {
                InventoryItem item = PXSelect <InventoryItem, Where <InventoryItem.inventoryID, Equal <Required <InventoryItem.inventoryID> > > > .Select(this, row.CompInventoryID);

                if (item != null)
                {
                    row.UOM = item.BaseUnit;
                }
            }
        }
        protected virtual void INKitSpecNonStkDet_RowUpdating(PXCache sender, PXRowUpdatingEventArgs e)
        {
            INKitSpecNonStkDet row = e.NewRow as INKitSpecNonStkDet;

            if (row != null)
            {
                if (row.AllowQtyVariation == true)
                {
                    if (((row.MinCompQty != null) && (row.DfltCompQty < row.MinCompQty)) ||
                        ((row.MaxCompQty != null) && (row.DfltCompQty > row.MaxCompQty)))
                    {
                        throw new PXSetPropertyException(typeof(INKitSpecNonStkDet.dfltCompQty).Name, null, Messages.DfltQtyShouldBeBetweenMinAndMaxQty);
                    }
                }

                if (row.KitInventoryID == row.CompInventoryID)
                {
                    throw new PXSetPropertyException(typeof(INKitSpecNonStkDet.compInventoryID).Name, null, Messages.KitMayNotIncludeItselfAsComponentPart);
                }
            }
        }
        protected virtual void INKitSpecNonStkDet_CompInventoryID_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e)
        {
            INKitSpecNonStkDet row = e.Row as INKitSpecNonStkDet;

            if (row != null)
            {
                PXSelectBase <INKitSpecNonStkDet> select = new PXSelect <INKitSpecNonStkDet,
                                                                         Where <INKitSpecNonStkDet.kitInventoryID, Equal <Current <INKitSpecHdr.kitInventoryID> >,
                                                                                And <INKitSpecNonStkDet.revisionID, Equal <Current <INKitSpecHdr.revisionID> >,
                                                                                     And <INKitSpecNonStkDet.compInventoryID, Equal <Required <INKitSpecStkDet.compInventoryID> > > > > >(this);

                PXResultset <INKitSpecNonStkDet> res = select.Select(e.NewValue);

                if (res.Count > 0)
                {
                    InventoryItem item = InventoryItem.PK.Find(this, (int?)e.NewValue);
                    var           ex   = new PXSetPropertyException(Messages.KitItemMustBeUnique);
                    ex.ErrorValue = item?.InventoryCD;
                    throw ex;
                }
            }
        }