示例#1
0
        protected void RMReport_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected del)
        {
            if (e.Row == null)
            {
                return;
            }

            PXUIFieldAttribute.SetVisible <RMReportGL.requestAccountClassID>(sender, e.Row, ((RMReport)e.Row).Type == RMType.GL);
            PXUIFieldAttribute.SetVisible <RMReportGL.requestEndAccount>(sender, e.Row, ((RMReport)e.Row).Type == RMType.GL);
            PXUIFieldAttribute.SetVisible <RMReportGL.requestEndSub>(sender, e.Row, ((RMReport)e.Row).Type == RMType.GL);
            PXUIFieldAttribute.SetVisible <RMReportGL.requestLedgerID>(sender, e.Row, ((RMReport)e.Row).Type == RMType.GL);
            PXUIFieldAttribute.SetVisible <RMReportGL.requestStartAccount>(sender, e.Row, ((RMReport)e.Row).Type == RMType.GL);
            PXUIFieldAttribute.SetVisible <RMReportGL.requestStartSub>(sender, e.Row, ((RMReport)e.Row).Type == RMType.GL);
            PXUIFieldAttribute.SetVisible <RMReportGL.requestStartBranch>(sender, e.Row, ((RMReport)e.Row).Type == RMType.GL);
            PXUIFieldAttribute.SetVisible <RMReportGL.requestEndBranch>(sender, e.Row, ((RMReport)e.Row).Type == RMType.GL);
            del(sender, e);
        }
示例#2
0
 protected void APInvoice_RowSelected(PXCache cache, PXRowSelectedEventArgs args, PXRowSelected baseHandler)
 {
     if (!(args.Row is APInvoice))
     {
         return;
     }
     baseHandler(cache, args);
     Base.Document.Cache.AllowUpdate = true;
 }
        protected virtual void Customer_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
        {
            if (InvokeBaseHandler != null)
            {
                InvokeBaseHandler(sender, e);
            }

            Customer customer = e.Row as Customer;

            if (customer == null)
            {
                return;
            }

            UpdateContactFields(customer);
        }
示例#4
0
        protected virtual void ARCashSale_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected bs)
        {
            if (bs != null)
            {
                bs(sender, e);
            }
            AR.Standalone.ARCashSale row = e.Row as AR.Standalone.ARCashSale;
            if (row == null)
            {
                return;
            }
            bool           isWithinContext = Base.IsWithinContext;
            GLVoucher      voucher         = this.Voucher.Select();
            GLVoucherBatch voucherBatch    = this.VoucherBatch.Select();
            PXCache        voucherCache    = this.Voucher.Cache;
            bool           isDetached      = (voucher == null);

            PXUIFieldAttribute.SetEnabled <GLVoucher.refNbr>(voucherCache, voucher, false);
            PXUIFieldAttribute.SetVisible <GLVoucher.refNbr>(voucherCache, voucher, !isDetached);
            PXUIFieldAttribute.SetEnabled <AR.Standalone.ARCashSale.refNbr>(sender, e.Row, !isWithinContext);
            this.SaveAndAdd.SetVisible(!isDetached && isWithinContext);
            this.SaveAndAdd.SetEnabled(!isDetached && isWithinContext);
            if (isWithinContext)
            {
                Base.release.SetVisible(false);
                Base.release.SetEnabled(false);
                Base.voidCheck.SetVisible(false);
                Base.voidCheck.SetEnabled(false);
            }
            PXUIFieldAttribute.SetVisible <GLVoucher.voucherBatchNbr>(Voucher.Cache, null, !isDetached && !isWithinContext);
            PXUIFieldAttribute.SetVisible <GLVoucher.workBookID>(Voucher.Cache, null, !isDetached && !isWithinContext);
            if (isWithinContext && !isDetached)
            {
                sender.AllowInsert = !(voucherBatch != null && voucherBatch.Released == true);
            }
        }
示例#5
0
 protected void XRBGLDist_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected del)
 {
     // Event handler body before the base BLC event handler collection
     if (del != null)
     {
         del(sender, e);
     }
     // Event handler body after the base BLC event handler collection
     if (e.Row != null)
     {
         XRBGLDist row = (XRBGLDist)e.Row;
         PXUIFieldAttribute.SetEnabled <XRBGLDistExt.usrDiscountReasonID>(sender, e.Row, (bool)row.ManualDisc);
         PXUIFieldAttribute.SetEnabled <XRBGLDist.discountID>(sender, e.Row, false);
     }
 }
        protected virtual void SOOrder_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected baseMethod)
        {
            baseMethod(cache, e);
            SOOrderRUTROT doc = RUTROTHelper.GetExtensionNullable <SOOrder, SOOrderRUTROT>(e.Row as SOOrder);

            if (doc == null)
            {
                return;
            }

            if (doc.IsRUTROTDeductible == true)
            {
                PXUIFieldAttribute.SetEnabled <SOOrder.billSeparately>(cache, e.Row, false);
            }

            RRManager.Update((SOOrder)e.Row);
            UpdateLinesControls(doc.IsRUTROTDeductible == true);
        }
        protected void RMReport_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected del)
        {
            if (e.Row == null)
            {
                return;
            }

            PXUIFieldAttribute.SetVisible <RMReportGL.requestAccountClassID>(sender, e.Row, ((RMReport)e.Row).Type == RMType.GL);
            PXUIFieldAttribute.SetVisible <RMReportGL.requestEndAccount>(sender, e.Row, ((RMReport)e.Row).Type == RMType.GL);
            PXUIFieldAttribute.SetVisible <RMReportGL.requestEndSub>(sender, e.Row, ((RMReport)e.Row).Type == RMType.GL);
            PXUIFieldAttribute.SetVisible <RMReportGL.requestLedgerID>(sender, e.Row, ((RMReport)e.Row).Type == RMType.GL);
            PXUIFieldAttribute.SetVisible <RMReportGL.requestStartAccount>(sender, e.Row, ((RMReport)e.Row).Type == RMType.GL);
            PXUIFieldAttribute.SetVisible <RMReportGL.requestStartSub>(sender, e.Row, ((RMReport)e.Row).Type == RMType.GL);
            PXUIFieldAttribute.SetVisible <RMReportGL.requestStartBranch>(sender, e.Row, ((RMReport)e.Row).Type == RMType.GL);
            PXUIFieldAttribute.SetVisible <RMReportGL.requestEndBranch>(sender, e.Row, ((RMReport)e.Row).Type == RMType.GL);
            PXUIFieldAttribute.SetVisible <RMReportGL.requestOrganizationID>(sender, e.Row, ((RMReport)e.Row).Type == RMType.GL);
            PXUIFieldAttribute.SetVisible <RMReportGL.requestUseMasterCalendar>(sender, e.Row, ((RMReport)e.Row).Type == RMType.GL &&
                                                                                PXAccess.FeatureInstalled <FeaturesSet.multipleCalendarsSupport>());
            del(sender, e);
        }
示例#8
0
        protected virtual void CRQuote_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected sel)
        {
            sel?.Invoke(sender, e);

            CRQuote row = e.Row as CRQuote;

            if (row == null)
            {
                return;
            }

            VisibilityHandler(sender, row);
        }
        public void POReceiptLine_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected BaseInvoke)
        {
            if (BaseInvoke != null)
            {
                BaseInvoke(sender, e);
            }

            if (e.Row == null)
            {
                return;
            }

            POReceiptLinePXExt lineExt = PXCache <POReceiptLine> .GetExtension <POReceiptLinePXExt>(e.Row as POReceiptLine);

            ApplyAttributes.SetVisible(lineExt.UsrLineLotSerTrack != INLotSerTrack.NotNumbered);
        }
 public virtual void SOOrder_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected del)
 {
     del?.Invoke(cache, e);
     AddBlanketOrderLineAction.SetEnabled(!IsBlanketOrder);
     PXUIFieldAttribute.SetVisible <SOLineDAExtension.dABlanketOrderQty>(Base.Transactions.Cache, null, IsBlanketOrder);
 }
        protected virtual void LocationExtAddress_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
        {
            if (InvokeBaseHandler != null)
            {
                InvokeBaseHandler(sender, e);
            }

            LocationExtAddress address = e.Row as LocationExtAddress;

            if (address == null)
            {
                return;
            }

            if (address.IsAddressSameAsMain != null)
            {
                bool enabled = !(address.IsAddressSameAsMain ?? false);

                PXUIFieldAttribute.SetEnabled <MXAddressExtension.street>(sender, address, enabled);
                PXUIFieldAttribute.SetEnabled <MXAddressExtension.extNumber>(sender, address, enabled);
                PXUIFieldAttribute.SetEnabled <MXAddressExtension.intNumber>(sender, address, enabled);
                PXUIFieldAttribute.SetEnabled <MXAddressExtension.neighborhood>(sender, address, enabled);
                PXUIFieldAttribute.SetEnabled <MXAddressExtension.municipality>(sender, address, enabled);
                PXUIFieldAttribute.SetEnabled <MXAddressExtension.reference>(sender, address, enabled);
            }
        }
        protected virtual void SOOrder_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected BaseEvent)
        {
            SOOrder row = e.Row as SOOrder;

            if (BaseEvent != null)
            {
                BaseEvent(sender, e);
            }

            if (row == null)
            {
                return;
            }
            SOOrderAmazonExt objSOAmazonOrderext = row.GetExtension <SOOrderAmazonExt>();

            if (objSOAmazonOrderext != null && !string.IsNullOrEmpty(objSOAmazonOrderext.UsrAmazonOrderID))
            {
                PXUIFieldAttribute.SetVisible <SOOrderAmazonExt.usrSyncNote>(sender, null, true);
                PXUIFieldAttribute.SetEnabled <SOOrder.customerRefNbr>(sender, row, false);
            }
        }
        protected virtual void SOShipment_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected baseHandler)
        {
            baseHandler?.Invoke(sender, e);

            if (e.Row == null)
            {
                return;
            }

            SOShipment      row           = (SOShipment)e.Row;
            KCSOShipmentExt rowKCExt      = row.GetExtension <KCSOShipmentExt>();
            SOOrderShipment orderShipment = PXSelect <SOOrderShipment, Where <SOOrderShipment.shipmentNbr,
                                                                              Equal <Required <SOOrderShipment.shipmentNbr> > > > .Select(Base, row.ShipmentNbr);

            if (orderShipment != null)
            {
                SOOrder order = PXSelect <SOOrder, Where <SOOrder.orderNbr,
                                                          Equal <Required <SOOrder.orderNbr> > > > .Select(Base, orderShipment.OrderNbr);

                bool?FBA         = order?.GetExtension <KCSOOrderExt>().UsrKCSiteName?.EndsWith("/FBA");
                var  buttonMenus = (Base.Actions["action"].GetState(null) as PXButtonState)?.Menus;

                if (FBA == true)
                {
                    bool enable = Base.Accessinfo.ScreenID == "KC.50.10.00";

                    var reportMenus = (Base.report.GetState(null) as PXButtonState)?.Menus;

                    foreach (var action in reportMenus)
                    {
                        action.Enabled = enable;
                    }

                    foreach (var action in buttonMenus)
                    {
                        if (action.Text != "Prepare Invoice")
                        {
                            action.Enabled = enable;
                        }
                    }

                    Base.Actions["InventorySummary"].SetEnabled(enable);
                    Base.Actions["LSSOShipLine_binLotSerial"].SetEnabled(enable);
                    Base.CarrierRatesExt.recalculatePackages.SetEnabled(enable);
                    Base.UpdateIN.SetEnabled(enable);
                    Base.Delete.SetEnabled(enable);

                    sender.AllowUpdate = enable;

                    Base.Transactions.Cache.AllowInsert = enable;
                    Base.Transactions.Cache.AllowUpdate = enable;
                    Base.Transactions.Cache.AllowDelete = enable;

                    Base.OrderList.View.AllowInsert = enable;
                    Base.OrderList.View.AllowUpdate = enable;
                    Base.OrderList.View.AllowDelete = enable;
                }
                else if (rowKCExt?.UsrKCExported == true)
                {
                    foreach (var action in buttonMenus)
                    {
                        if (action.Text.Equals("Correct Shipment"))
                        {
                            action.Enabled = false;
                        }
                    }
                }
            }
        }
        protected virtual void PayBillsFilter_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected del)
        {
            if (e.Row == null)
            {
                return;
            }
            var filter    = (PayBillsFilter)e.Row;
            var filterExt = PXCache <PayBillsFilter> .GetExtension <PayBillsFilterExt>(filter);

            //Direct Deposit only works with USD
            if (filterExt.PaymentType == PaymentChargeType.DirectDeposit && filter.CuryID != "USD")
            {
                cache.SetValueExt <PayBillsFilter.curyID>(filter, "USD");
            }
            PXUIFieldAttribute.SetEnabled <PayBillsFilter.curyID>(cache, filter, filterExt.PaymentType != PaymentChargeType.DirectDeposit);

            if (filterExt.PaymentType == PaymentChargeType.DirectDeposit)
            {
                PXGraph.InstanceCreated.AddHandler <ARPaymentEntry>(HandleSetDescriptionRefName);
            }
            else
            {
                PXGraph.InstanceCreated.RemoveHandler <ARPaymentEntry>(HandleSetDescriptionRefName);
            }
            if (del != null)
            {
                del(cache, e);
            }
        }
        protected virtual void PaymentMethod_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected del)
        {
            if (e.Row == null)
            {
                return;
            }

            var row    = (PaymentMethod)e.Row;
            var rowExt = PXCache <PaymentMethod> .GetExtension <PaymentMethodExt>(row);

            bool isDirectDeposit          = (row.PaymentType != PaymentMethodType.CreditCard);
            bool missingConfigCreateBatch = (rowExt.ARCreateBatchPayment == true && (row.UseForCA != true || row.IsAccountNumberRequired != true));
            bool createARBatch            = (rowExt.ARCreateBatchPayment == true);


            PXUIFieldAttribute.SetVisible <PaymentMethodExt.aRCreateBatchPayment>(cache, row, isDirectDeposit);
            PXUIFieldAttribute.SetWarning <PaymentMethodExt.aRCreateBatchPayment>(cache, row, missingConfigCreateBatch ? Messages.WarningSettingACHPaymentMethod
                                                                                                                      : String.Empty);

            PXUIFieldAttribute.SetVisible <PaymentMethodExt.aRBatchExportSYMappingID>(cache, row, isDirectDeposit && createARBatch);
            PXUIFieldAttribute.SetEnabled <PaymentMethodExt.aRBatchExportSYMappingID>(cache, row, isDirectDeposit && createARBatch);
            PXUIFieldAttribute.SetRequired <PaymentMethodExt.aRBatchExportSYMappingID>(cache, isDirectDeposit && createARBatch);
            insertDefaultData.SetVisible(isDirectDeposit && createARBatch);

            if (del != null)
            {
                del(cache, e);
            }

            //Note they need to be call after the delegate because they are overriding an operation from it
            bool isCreditCard = (row.PaymentType == PaymentMethodType.CreditCard);

            PXUIFieldAttribute.SetVisible <PaymentMethodDetail.isIdentifier>(Base.Details.Cache, null, isCreditCard || (isDirectDeposit && createARBatch));
            PXUIFieldAttribute.SetEnabled <PaymentMethodDetail.isIdentifier>(Base.Details.Cache, null, isCreditCard || (isDirectDeposit && createARBatch));

            PXUIFieldAttribute.SetVisible <PaymentMethodDetail.displayMask>(Base.Details.Cache, null, isCreditCard || (isDirectDeposit && createARBatch));
            PXUIFieldAttribute.SetEnabled <PaymentMethodDetail.displayMask>(Base.Details.Cache, null, isCreditCard || (isDirectDeposit && createARBatch));

            PXUIFieldAttribute.SetVisible <PaymentMethodDetail.isEncrypted>(Base.Details.Cache, null, !(isDirectDeposit && createARBatch));
            PXUIFieldAttribute.SetEnabled <PaymentMethodDetail.isEncrypted>(Base.Details.Cache, null, !(isDirectDeposit && createARBatch));

            PXUIFieldAttribute.SetVisible <PaymentMethodDetail.orderIndex>(Base.Details.Cache, null, !(isDirectDeposit && createARBatch));
            PXUIFieldAttribute.SetEnabled <PaymentMethodDetail.orderIndex>(Base.Details.Cache, null, !(isDirectDeposit && createARBatch));

            //We use a common field for batch numbering
            PXUIFieldAttribute.SetVisible <PaymentMethodAccount.aPBatchLastRefNbr>(Base.CashAccounts.Cache, null, row.UseForAP == true || (isDirectDeposit && createARBatch));
        }
示例#16
0
 protected void InventoryItem_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected del)
 {
     //execute the event handler of the base graph
     if (del != null)
     {
         del(sender, e);
     }
     //implement the extension code
 }
        protected virtual void CABatch_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected del)
        {
            if (del != null)
            {
                del(sender, e);
            }

            Transfer.CABatch_RowSelected(sender, e);
        }
示例#18
0
        /* Events */

        protected void XRBContrHdr_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected del)
        {
            // Event handler body before the base BLC event handler collection
            if (del != null)
            {
                del(sender, e);
            }
            // Event handler body after the base BLC event handler collection
            if (e.Row != null)
            {
                XRBContrHdr doc = e.Row as XRBContrHdr;
                if (doc != null)
                {
                    XRBContrDet current = PXSelect <XRBContrDet,
                                                    Where <XRBContrDet.manuallyBooked, Equal <False>,
                                                           And <XRBContrDet.contractID,
                                                                Equal <Required <XRBContrHdr.contractID> > > > > .Select(Base, doc.ContractID);

                    if (current != null)
                    {
                        var count = PXSelect <XRBGLDist,
                                              Where <XRBGLDist.contractID, Equal <Required <XRBContrDet.contractID> >,
                                                     And <XRBGLDist.contrDetLineNbr, Equal <Required <XRBContrDet.lineNbr> > > > > .Select(Base, current.ContractID, current.LineNbr).Count;

                        if (count > 0)
                        {
                            PXUIFieldAttribute.SetEnabled <XRBContrHdrExt.usrLineofBusiness>(sender, doc, false);
                        }
                        else
                        {
                            PXUIFieldAttribute.SetEnabled <XRBContrHdrExt.usrLineofBusiness>(sender, doc, true);
                        }
                    }
                    PXDefaultAttribute.SetPersistingCheck <XRBContrHdr.classID>(sender, doc, PXPersistingCheck.NullOrBlank);
                }
            }
        }
示例#19
0
        protected void CROpportunity_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected sel)
        {
            sel?.Invoke(cache, e);

            if (e.Row == null)
            {
                return;
            }

            CROpportunity    crOpportunityRow    = (CROpportunity)e.Row;
            FSxCROpportunity fsxCROpportunityRow = cache.GetExtension <FSxCROpportunity>(crOpportunityRow);

            FSServiceOrder fsServiceOrderRow = CRExtensionHelper.GetRelatedServiceOrder(Base, cache, crOpportunityRow, fsxCROpportunityRow.SOID);
            FSSrvOrdType   fsSrvOrdTypeRow   = null;

            if (fsServiceOrderRow != null)
            {
                fsSrvOrdTypeRow = CRExtensionHelper.GetServiceOrderType(Base, fsServiceOrderRow.SrvOrdType);
            }

            EnableDisableCustomFields(cache, crOpportunityRow, fsxCROpportunityRow, fsServiceOrderRow, fsSrvOrdTypeRow);
            EnableDisableActions(cache, crOpportunityRow, fsxCROpportunityRow, fsServiceOrderRow, fsSrvOrdTypeRow);
            SetPersistingChecks(cache, crOpportunityRow, fsxCROpportunityRow, fsSrvOrdTypeRow);
        }
        protected void RMReport_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected del)
        {
            if (e.Row == null)
            {
                return;
            }

            PXUIFieldAttribute.SetVisible <RMReportPM.requestStartAccountGroup>(sender, e.Row, ((RMReport)e.Row).Type == RMType.PM);
            PXUIFieldAttribute.SetVisible <RMReportPM.requestEndAccountGroup>(sender, e.Row, ((RMReport)e.Row).Type == RMType.PM);
            PXUIFieldAttribute.SetVisible <RMReportPM.requestStartProject>(sender, e.Row, ((RMReport)e.Row).Type == RMType.PM);
            PXUIFieldAttribute.SetVisible <RMReportPM.requestEndProject>(sender, e.Row, ((RMReport)e.Row).Type == RMType.PM);
            PXUIFieldAttribute.SetVisible <RMReportPM.requestStartProjectTask>(sender, e.Row, ((RMReport)e.Row).Type == RMType.PM);
            PXUIFieldAttribute.SetVisible <RMReportPM.requestEndProjectTask>(sender, e.Row, ((RMReport)e.Row).Type == RMType.PM);
            PXUIFieldAttribute.SetVisible <RMReportPM.requestStartInventory>(sender, e.Row, ((RMReport)e.Row).Type == RMType.PM);
            PXUIFieldAttribute.SetVisible <RMReportPM.requestEndInventory>(sender, e.Row, ((RMReport)e.Row).Type == RMType.PM);
            del(sender, e);
        }
示例#21
0
        protected virtual void CROpportunityProducts_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected sel)
        {
            sel?.Invoke(cache, e);

            if (e.Row == null)
            {
                return;
            }

            CROpportunityProducts    crOpportunityProductsRow    = (CROpportunityProducts)e.Row;
            FSxCROpportunityProducts fsxCROpportunityProductsRow = cache.GetExtension <FSxCROpportunityProducts>(crOpportunityProductsRow);

            if (fsxCROpportunityProductsRow != null)
            {
                InventoryItem inventoryItemRow = SharedFunctions.GetInventoryItemRow(Base, crOpportunityProductsRow.InventoryID);

                if (inventoryItemRow != null)
                {
                    PXUIFieldAttribute.SetEnabled <FSxCROpportunityProducts.billingRule>(cache, crOpportunityProductsRow, inventoryItemRow.ItemType == INItemTypes.ServiceItem);
                    PXUIFieldAttribute.SetEnabled <FSxCROpportunityProducts.estimatedDuration>(cache, crOpportunityProductsRow, inventoryItemRow.ItemType == INItemTypes.ServiceItem || inventoryItemRow.ItemType == INItemTypes.NonStockItem);
                    PXUIFieldAttribute.SetEnabled <CROpportunityProducts.curyUnitCost>(cache, crOpportunityProductsRow, crOpportunityProductsRow.POCreate == true);
                    PXUIFieldAttribute.SetEnabled <FSxCROpportunityProducts.vendorLocationID>(cache, crOpportunityProductsRow, crOpportunityProductsRow.POCreate == true);
                    PXUIFieldAttribute.SetEnabled <CROpportunityProducts.quantity>(cache, crOpportunityProductsRow, fsxCROpportunityProductsRow.BillingRule != ID.BillingRule.TIME);
                }
            }
        }
        protected virtual void APInvoice_RowSelected(PXCache sender, PXRowSelectedEventArgs e, PXRowSelected bs)
        {
            if (bs != null)
            {
                bs(sender, e);
            }
            APInvoice row = e.Row as APInvoice;

            if (row == null)
            {
                return;
            }
            bool           isWithinContext = Base.IsWithinContext;
            GLVoucher      voucher         = this.Voucher.Select();
            GLVoucherBatch voucherBatch    = this.VoucherBatch.Select();
            PXCache        voucherCache    = this.Voucher.Cache;
            bool           isDetached      = (voucher == null);

            PXUIFieldAttribute.SetEnabled <GLVoucher.refNbr>(voucherCache, voucher, false);
            PXUIFieldAttribute.SetVisible <GLVoucher.refNbr>(voucherCache, voucher, !isDetached);
            PXUIFieldAttribute.SetEnabled <APInvoice.refNbr>(sender, e.Row, !isWithinContext);
            this.SaveAndAdd.SetVisible(!isDetached && isWithinContext);
            this.SaveAndAdd.SetEnabled(!isDetached && isWithinContext);
            if (isWithinContext)
            {
                Base.release.SetVisible(false);
                Base.release.SetEnabled(false);
                Base.voidInvoice.SetVisible(false);
                Base.voidInvoice.SetEnabled(false);
                Base.voidDocument.SetVisible(false);
                Base.voidDocument.SetEnabled(false);
                Base.voidCheck.SetVisible(false);
                Base.voidCheck.SetEnabled(false);
            }
            if (!isDetached)
            {
                try
                {
                    Base.action.SetEnabled("Add to Schedule", false);
                }
                catch { }
                Base.createSchedule.SetEnabled(false);
            }
            PXUIFieldAttribute.SetVisible <GLVoucher.voucherBatchNbr>(Voucher.Cache, null, !isDetached && !isWithinContext);
            PXUIFieldAttribute.SetVisible <GLVoucher.workBookID>(Voucher.Cache, null, !isDetached && !isWithinContext);
            if (isWithinContext && !isDetached)
            {
                sender.AllowInsert = !(voucherBatch != null && voucherBatch.Released == true);
            }
        }
        protected virtual void MobileNotification_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected baseMethod)
        {
            if (baseMethod != null)
            {
                baseMethod.Invoke(cache, e);
            }
            var row = e.Row as MobileNotification;

            if (row == null)
            {
                return;
            }
            bool isTeamsNotification = row.DeliveryType == (byte)3;

            PXUIFieldAttribute.SetVisible <MobileNotification.destinationEntityID>(cache, row, !isTeamsNotification);
            PXUIFieldAttribute.SetVisible <MobileNotification.destinationScreenID>(cache, row, !isTeamsNotification);
            PXUIFieldAttribute.SetVisible <MobileNotification.subject>(cache, row, !isTeamsNotification);
            PXUIFieldAttribute.SetVisible <MobileNotification.nfrom>(cache, row, !isTeamsNotification);
            PXUIFieldAttribute.SetVisible <MobileNotification.nto>(cache, row, !isTeamsNotification);
            PXUIFieldAttribute.SetVisible <MobileNotificationExt.usrTo>(cache, row, isTeamsNotification);

            PXDefaultAttribute.SetPersistingCheck <MobileNotification.nto>(cache, row, isTeamsNotification ? PXPersistingCheck.Nothing : PXPersistingCheck.NullOrBlank);
        }