protected virtual void INRegister_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { if (e.Row == null) { return; } release.SetEnabled(e.Row != null && ((INRegister)e.Row).Hold == false && ((INRegister)e.Row).Released == false); iNEdit.SetEnabled(e.Row != null && ((INRegister)e.Row).Hold == false && ((INRegister)e.Row).Released == false); iNRegisterDetails.SetEnabled(e.Row != null && ((INRegister)e.Row).Released == true); PXUIFieldAttribute.SetEnabled(sender, e.Row, ((INRegister)e.Row).Released == false && ((INRegister)e.Row).OrigModule == GL.BatchModule.IN); PXUIFieldAttribute.SetEnabled <INRegister.refNbr>(sender, e.Row, true); PXUIFieldAttribute.SetEnabled <INRegister.totalQty>(sender, e.Row, false); PXUIFieldAttribute.SetEnabled <INRegister.status>(sender, e.Row, false); PXUIFieldAttribute.SetEnabled <INRegister.branchID>(sender, e.Row, false); sender.AllowInsert = true; sender.AllowUpdate = (((INRegister)e.Row).Released == false); sender.AllowDelete = (((INRegister)e.Row).Released == false && ((INRegister)e.Row).OrigModule == GL.BatchModule.IN); lsselect.AllowInsert = (((INRegister)e.Row).Released == false && ((INRegister)e.Row).OrigModule == GL.BatchModule.IN && ((INRegister)e.Row).SiteID != null); lsselect.AllowUpdate = (((INRegister)e.Row).Released == false); lsselect.AllowDelete = (((INRegister)e.Row).Released == false && ((INRegister)e.Row).OrigModule == GL.BatchModule.IN); PXUIFieldAttribute.SetVisible <INRegister.controlQty>(sender, e.Row, (bool)insetup.Current.RequireControlTotal); PXUIFieldAttribute.SetEnabled <INRegister.siteID>(sender, e.Row, ((INRegister)e.Row).Released == false && (((INRegister)e.Row).SiteID == null || transactions.Select().Count == 0)); PXUIFieldAttribute.SetEnabled <INRegister.transferType>(sender, e.Row, ((INRegister)e.Row).OrigModule == GL.BatchModule.IN && ((INRegister)e.Row).Released == false && (((INRegister)e.Row).SiteID == null || ((INRegister)e.Row).SiteID != ((INRegister)e.Row).ToSiteID)); PXUIFieldAttribute.SetVisible <INTran.toLocationID>(this.transactions.Cache, null, ((INRegister)e.Row).TransferType == INTransferType.OneStep); PXUIFieldAttribute.SetVisible <INTran.receiptedQty>(this.transactions.Cache, null, ((INRegister)e.Row).TransferType != INTransferType.OneStep); PXUIFieldAttribute.SetVisible <INTran.iNTransitQty>(this.transactions.Cache, null, ((INRegister)e.Row).TransferType != INTransferType.OneStep); PXDefaultAttribute.SetPersistingCheck <INTran.toLocationID>(this.transactions.Cache, null, ((INRegister)e.Row).TransferType == INTransferType.OneStep ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing); addInvBySite.SetEnabled(transactions.Cache.AllowInsert); }
protected virtual void GLAllocation_RowSelected(PXCache cache, PXRowSelectedEventArgs e) { if (e.Row == null) { return; } GLAllocation record = (GLAllocation)e.Row; bool isBasisAcctEnabled = (record.AllocMethod == Constants.AllocationMethod.ByAcctPTD) || (record.AllocMethod == Constants.AllocationMethod.ByAcctYTD); PXUIFieldAttribute.SetEnabled <GLAllocation.basisLederID>(cache, record, isBasisAcctEnabled); PXUIFieldAttribute.SetEnabled <GLAllocationDestination.basisBranchID>(this.Destination.Cache, null, isBasisAcctEnabled); PXUIFieldAttribute.SetEnabled <GLAllocationDestination.basisAccountCD>(this.Destination.Cache, null, isBasisAcctEnabled); PXUIFieldAttribute.SetEnabled <GLAllocationDestination.basisSubCD>(this.Destination.Cache, null, isBasisAcctEnabled); PXUIFieldAttribute.SetVisible <GLAllocationDestination.basisBranchID>(this.Destination.Cache, null, isBasisAcctEnabled); PXUIFieldAttribute.SetVisible <GLAllocationDestination.basisAccountCD>(this.Destination.Cache, null, isBasisAcctEnabled); PXUIFieldAttribute.SetVisible <GLAllocationDestination.basisSubCD>(this.Destination.Cache, null, isBasisAcctEnabled); bool isWeightEnabled = (record.AllocMethod == Constants.AllocationMethod.ByWeight) || (record.AllocMethod == Constants.AllocationMethod.ByPercent); PXUIFieldAttribute.SetEnabled <GLAllocationDestination.weight>(this.Destination.Cache, null, isWeightEnabled); PXUIFieldAttribute.SetVisible <GLAllocationDestination.weight>(this.Destination.Cache, null, isWeightEnabled); }
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); } }
protected virtual void CurrencyInfo_RowSelected(PXCache cache, PXRowSelectedEventArgs e) { CurrencyInfo info = e.Row as CurrencyInfo; if (info != null && ClaimDetails.Current != null) { bool rateenabled = info.AllowUpdate(ClaimDetails.Cache) && ClaimDetails.Current.EmployeeID != null; if (rateenabled) { CurrencyList curyList = (CurrencyList)PXSelectorAttribute.Select <CurrencyInfo.curyID>(cache, info); if (curyList != null && curyList.IsFinancial == true) { EPEmployee employee = (EPEmployee)PXSelect <EPEmployee, Where <EPEmployee.bAccountID, Equal <Current <EPExpenseClaimDetails.employeeID> > > > .SelectSingleBound(this, new object[] { ClaimDetails.Current }); rateenabled = employee != null && employee.AllowOverrideRate == true; } } PXUIFieldAttribute.SetEnabled <CurrencyInfo.curyRateTypeID>(cache, info, rateenabled); PXUIFieldAttribute.SetEnabled <CurrencyInfo.curyEffDate>(cache, info, rateenabled); PXUIFieldAttribute.SetEnabled <CurrencyInfo.sampleCuryRate>(cache, info, rateenabled); PXUIFieldAttribute.SetEnabled <CurrencyInfo.sampleRecipRate>(cache, info, rateenabled); } }
protected virtual void RQBiddingVendor_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { RQBiddingVendor row = (RQBiddingVendor)e.Row; if (row == null) { return; } RQBiddingVendorExt rowExt = row.GetExtension <RQBiddingVendorExt>(); bool bidExists = row.CuryTotalQuoteExtCost > Decimal.Zero == true; RQRequisition req = PXSelect <RQRequisition, Where <RQRequisition.reqNbr, Equal <Required <RQRequisition.reqNbr> > > > .Select(Base, row.ReqNbr); RQRequisitionExt reqExt = req.GetExtension <RQRequisitionExt>(); if (bidExists) { if (req.CustomerID != null || reqExt.UsrPurchMethod != 2) { if (req.CustomerID != null) { PXDefaultAttribute.SetPersistingCheck <RQBiddingVendorExt.usrIncoterm>(sender, row, bidExists ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing); } PXDefaultAttribute.SetPersistingCheck <RQBiddingVendorExt.usrLeadFrom>(sender, row, bidExists ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing); PXDefaultAttribute.SetPersistingCheck <RQBiddingVendorExt.usrLeadTime>(sender, row, bidExists ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing); PXDefaultAttribute.SetPersistingCheck <RQBiddingVendorExt.usrRefDueDate>(sender, row, bidExists ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing); } } //ValidateLeadTime(sender, e); }
protected virtual void ApproveBillsFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { PXUIFieldAttribute.SetEnabled(APDocumentList.Cache, null, false); PXUIFieldAttribute.SetEnabled <APInvoice.paySel>(APDocumentList.Cache, null, true); PXUIFieldAttribute.SetEnabled <APInvoice.payLocationID>(APDocumentList.Cache, null, true); PXUIFieldAttribute.SetEnabled <APInvoice.payAccountID>(APDocumentList.Cache, null, true); PXUIFieldAttribute.SetEnabled <APInvoice.payTypeID>(APDocumentList.Cache, null, true); PXUIFieldAttribute.SetEnabled <APInvoice.payDate>(APDocumentList.Cache, null, true); PXUIFieldAttribute.SetEnabled <APInvoice.separateCheck>(APDocumentList.Cache, null, true); PXUIFieldAttribute.SetVisible <ApproveBillsFilter.curyID>(sender, null, PXAccess.FeatureInstalled <FeaturesSet.multicurrency>()); PXUIFieldAttribute.SetDisplayName <APInvoice.selected>(APDocumentList.Cache, Messages.Approve); PXUIFieldAttribute.SetDisplayName <APInvoice.vendorID>(APDocumentList.Cache, Messages.VendorID); APDocumentList.Cache.AllowInsert = APDocumentList.Cache.AllowDelete = false; ApproveBillsFilter row = e.Row as ApproveBillsFilter; if (row != null) { row.Days = PXMessages.LocalizeNoPrefix(row.Days); } }
protected virtual void DisposalFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { DisposalFilter filter = (DisposalFilter)e.Row; if (filter == null) { return; } Assets.SetProcessEnabled(filter.DisposalMethodID != null); Assets.SetProcessAllEnabled(filter.DisposalMethodID != null); PXProcessingStep[] targets = PXAutomation.GetProcessingSteps(this); if (targets.Length > 0) { Assets.SetProcessTarget(targets[0].GraphName, targets.Length > 1 ? null : targets[0].Name, targets[0].Actions[0].Name, targets[0].Actions[0].Menus[0], filter.DisposalDate, filter.DisposalPeriodID, filter.DisposalAmt, filter.DisposalMethodID, filter.DisposalAccountID, filter.DisposalSubID, filter.DisposalAmtMode, filter.DeprBeforeDisposal, filter.Reason); } else { throw new PXException(SO.Messages.MissingMassProcessWorkFlow); } PXUIFieldAttribute.SetEnabled <DisposalFilter.disposalAmt>(sender, e.Row, filter.DisposalAmtMode == DisposalFilter.disposalAmtMode.Automatic); PXUIFieldAttribute.SetEnabled <FixedAsset.disposalAmt>(Assets.Cache, null, Filter.Current.DisposalAmtMode == DisposalFilter.disposalAmtMode.Manual); }
public virtual void ARExpiringCardFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { ARExpiringCardFilter row = e.Row as ARExpiringCardFilter; if (row == null) { return; } PXUIFieldAttribute.SetEnabled <CustomerPaymentMethod.selected>(this.Cards.Cache, null, true); if (row.TokenizedPMs == null) { string pmString = CCProcessingHelper.GetTokenizedPMsString(this); sender.SetValue <ARExpiringCardFilter.tokenizedPMs>(row, pmString); } else { if (row.TokenizedPMs != String.Empty) { Filter.Cache.RaiseExceptionHandling <ARExpiringCardFilter.customerClassID>(e.Row, ((ARExpiringCardFilter)e.Row).CustomerClassID, new PXSetPropertyException(Messages.NotAllCardsShown, PXErrorLevel.Warning, row.TokenizedPMs)); } } }
public void RowSelected(PXCache sender, PXRowSelectedEventArgs e) { if (e.Row == null) { return; } var paymentMethodID = sender.GetValue(e.Row, _PaymentMethodID.Name) as string; if (!String.IsNullOrEmpty(paymentMethodID)) { var paymentMethod = PXSelect <PaymentMethod, Where <PaymentMethod.paymentMethodID, Equal <Required <PaymentMethod.paymentMethodID> > > > .Select(sender.Graph, paymentMethodID); var paymentMethodExt = PXCache <PaymentMethod> .GetExtension <PaymentMethodExt>(paymentMethod); if (paymentMethodExt != null && paymentMethodExt.ARCreateBatchPayment == true) { PXRSACryptStringAttribute.SetDecrypted(sender, base.FieldName, true); } } }
protected virtual void ActivityRowSelected(PXCache sender, PXRowSelectedEventArgs e) { var item = e.Row as EPActivity; if (item == null) { return; } var allowOverrideBillable = CurrentCaseClass.Current == null || CurrentCaseClass.Current.AllowOverrideBillable == true; var allowChangeBillableTime = CurrentCase.Current == null || CurrentCase.Current.Released != true; PXUIFieldAttribute.SetEnabled <EPActivity.isBillable>(sender, item, allowChangeBillableTime); PXUIFieldAttribute.SetEnabled <EPActivity.timeBillable>(sender, item, allowOverrideBillable && allowChangeBillableTime && (item.IsBillable ?? false)); PXUIFieldAttribute.SetEnabled <EPActivity.overtimeBillable>(sender, item, allowOverrideBillable && allowChangeBillableTime && (item.IsBillable ?? false)); PXUIFieldAttribute.SetEnabled <EPActivity.overtimeSpent>(sender, item, false); if (item.Billed == true) { PXUIFieldAttribute.SetEnabled(sender, item, false); } }
public void ValidationFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { ValidationFilter filter = (ValidationFilter)e.Row; Contacts.SetProcessDelegate(record => ProcessValidation(filter, record)); }
protected virtual void Dimension_RowSelected(PXCache cache, PXRowSelectedEventArgs e) { if (e.Row == null) { return; } Dimension dim = (Dimension)e.Row; dim.MaxLength = PXDimensionAttribute.GetMaxLength(dim.DimensionID); PXUIFieldAttribute.SetEnabled <Dimension.length>(cache, dim, false); PXUIFieldAttribute.SetVisible <Dimension.maxLength>(cache, dim, HasMaxLength(dim)); PXUIFieldAttribute.SetEnabled <Dimension.segments>(cache, dim, false); bool numberingIDEnabled = true; bool specificModule = true; bool validateEnabled = false; Detail.Cache.AllowInsert = true; Detail.Cache.AllowUpdate = true; Detail.Cache.AllowDelete = true; switch (dim.DimensionID) { case SubItemAttribute.DimensionName: validateEnabled = true; PXUIFieldAttribute.SetEnabled <Segment.autoNumber>(Detail.Cache, null, false); break; case SubAccountAttribute.DimensionName: validateEnabled = true; break; case AccountAttribute.DimensionName: break; case AR.CustomerAttribute.DimensionName: case AR.SalesPersonAttribute.DimensionName: case IN.InventoryAttribute.DimensionName: case IN.SiteAttribute.DimensionName: case IN.LocationAttribute.DimensionName: case AP.VendorAttribute.DimensionName: case AR.CustomerRawAttribute.DimensionName: case EP.EmployeeRawAttribute.DimensionName: case CR.LeadRawAttribute.DimensionName: validateEnabled = dim.Validate == false; PXUIFieldAttribute.SetEnabled <Segment.autoNumber>(Detail.Cache, null, true); PXUIFieldAttribute.SetVisible <Segment.isCosted>(Detail.Cache, null, false); break; default: validateEnabled = true; break; } cache.AllowDelete = dim.Internal != true; PXUIFieldAttribute.SetVisible <Segment.consolOrder>(Detail.Cache, null, dim.DimensionID == SubAccountAttribute.DimensionName); PXUIFieldAttribute.SetVisible <Segment.consolNumChar>(Detail.Cache, null, dim.DimensionID == SubAccountAttribute.DimensionName); PXUIFieldAttribute.SetVisible <Segment.isCosted>(Detail.Cache, null, dim.DimensionID == SubItemAttribute.DimensionName); bool hasParent = dim.ParentDimensionID != null; Detail.Cache.AllowInsert &= !hasParent; PXUIFieldAttribute.SetVisible <Segment.inherited>(Detail.Cache, null, hasParent); PXUIFieldAttribute.SetVisible <Segment.isOverrideForUI>(Detail.Cache, null, hasParent); PXUIFieldAttribute.SetEnabled <Dimension.numberingID>(cache, e.Row, numberingIDEnabled); PXUIFieldAttribute.SetEnabled <Dimension.specificModule>(cache, e.Row, specificModule); PXUIFieldAttribute.SetEnabled <Dimension.validate>(cache, e.Row, validateEnabled); }
protected virtual void INBarCodeItem_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { PXUIFieldAttribute.SetEnabled <INBarCodeItem.uOM>(this.AddByBarCode.Cache, null, false); }
public virtual void RQRequestSelection_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { RQRequestSelection filter = Filter.Current; Records.SetProcessDelegate(list => GenerateRequisition(filter, list)); }
protected virtual void BillingFilter_RowSelected(PXCache cache, PXRowSelectedEventArgs e) { BillingFilter filter = Filter.Current; Customers.SetProcessDelegate <EPCustomerBillingProcess>((docgraph, customer) => docgraph.Bill(customer, filter)); }
protected override List <Tuple <string, object> > CollectValues(PXCache sender, PXRowSelectedEventArgs e) { PXCache <FieldValue> fvcache = sender.Graph.Caches <FieldValue>(); return((fvcache.Inserted.OfType <FieldValue>() .Where(f => f.Hidden != true && f.Selected == true) .OrderBy(f => f.Order) .Select(field => new { field, state = fvcache.GetStateExt <FieldValue.value>(field) as PXFieldState }) .Where(@t => @t.state != null) .Select(@t => new Tuple <string, object>(@t.field.DisplayName, StateValue(@t.state as PXStringState) ?? StateValue(@t.state as PXIntState) ?? @t.state.Value))).ToList()); }
protected void FSPostBatch_RowSelected(PXCache cache, PXRowSelectedEventArgs e) { PXUIFieldAttribute.SetEnabled(BatchRecords.Cache, e.Row, false); PXUIFieldAttribute.SetEnabled <FSPostBatch.batchNbr>(BatchRecords.Cache, e.Row, true); BatchRecords.Cache.AllowInsert = false; }
protected virtual void PaymentMethod_RowSelected(PXCache cache, PXRowSelectedEventArgs e) { if (e.Row == null) { return; } PaymentMethod row = (PaymentMethod)e.Row; bool isCreditCard = (row.PaymentType == PaymentMethodType.CreditCard); bool printChecks = (row.APPrintChecks == true); bool createBatch = (row.APCreateBatchPayment == true); bool useForAP = row.UseForAP.GetValueOrDefault(false); bool useForAR = row.UseForAR.GetValueOrDefault(false); PXUIFieldAttribute.SetVisible <PaymentMethod.aPCheckReportID>(cache, row, printChecks); PXUIFieldAttribute.SetVisible <PaymentMethod.aPStubLines>(cache, row, printChecks); PXUIFieldAttribute.SetVisible <PaymentMethod.aPPrintRemittance>(cache, row, printChecks); PXUIFieldAttribute.SetVisible <PaymentMethod.aPRemittanceReportID>(cache, row, printChecks); PXUIFieldAttribute.SetEnabled <PaymentMethod.aPPrintRemittance>(cache, row, printChecks); PXUIFieldAttribute.SetEnabled <PaymentMethod.aPRemittanceReportID>(cache, row, printChecks && (row.APPrintRemittance == true)); PXUIFieldAttribute.SetRequired <PaymentMethod.aPRemittanceReportID>(cache, printChecks && (row.APPrintRemittance == true)); PXUIFieldAttribute.SetEnabled <PaymentMethod.aPCheckReportID>(cache, row, printChecks); PXUIFieldAttribute.SetRequired <PaymentMethod.aPCheckReportID>(cache, printChecks); PXUIFieldAttribute.SetEnabled <PaymentMethod.aPPrintChecks>(cache, row, true); PXUIFieldAttribute.SetEnabled <PaymentMethod.aPStubLines>(cache, row, printChecks); PXUIFieldAttribute.SetEnabled <PaymentMethod.aPCreateBatchPayment>(cache, row, !printChecks); PXUIFieldAttribute.SetVisible <PaymentMethod.aPBatchExportSYMappingID>(cache, row, createBatch); PXUIFieldAttribute.SetEnabled <PaymentMethod.aPBatchExportSYMappingID>(cache, row, createBatch); PXUIFieldAttribute.SetRequired <PaymentMethod.aPBatchExportSYMappingID>(cache, createBatch); PXUIFieldAttribute.SetVisible <PaymentMethod.aPRequirePaymentRef>(cache, row, !printChecks && !createBatch); PXUIFieldAttribute.SetVisible <PaymentMethodDetail.isExpirationDate>(this.Details.Cache, null, isCreditCard); PXUIFieldAttribute.SetVisible <PaymentMethodDetail.isIdentifier>(this.Details.Cache, null, isCreditCard); PXUIFieldAttribute.SetVisible <PaymentMethodDetail.isOwnerName>(this.Details.Cache, null, isCreditCard); PXUIFieldAttribute.SetVisible <PaymentMethodDetail.displayMask>(this.Details.Cache, null, isCreditCard); PXUIFieldAttribute.SetVisible <PaymentMethodDetail.isCCProcessingID>(this.Details.Cache, null, isCreditCard); PXUIFieldAttribute.SetEnabled <PaymentMethodDetail.isExpirationDate>(this.Details.Cache, null, isCreditCard); PXUIFieldAttribute.SetEnabled <PaymentMethodDetail.isIdentifier>(this.Details.Cache, null, isCreditCard); PXUIFieldAttribute.SetEnabled <PaymentMethodDetail.isIdentifier>(this.Details.Cache, null, isCreditCard); PXUIFieldAttribute.SetEnabled <PaymentMethodDetail.displayMask>(this.Details.Cache, null, isCreditCard); PXUIFieldAttribute.SetEnabled <PaymentMethodDetail.isCCProcessingID>(this.Details.Cache, null, isCreditCard); PXUIFieldAttribute.SetVisible <PaymentMethod.aRDepositAsBatch>(cache, null, false); PXUIFieldAttribute.SetEnabled <PaymentMethod.aRDepositAsBatch>(cache, null, false); PXUIFieldAttribute.SetVisible <PaymentMethodAccount.useForAP>(this.CashAccounts.Cache, null, useForAP); PXUIFieldAttribute.SetVisible <PaymentMethodAccount.aPIsDefault>(this.CashAccounts.Cache, null, useForAP); PXUIFieldAttribute.SetVisible <PaymentMethodAccount.aPAutoNextNbr>(this.CashAccounts.Cache, null, useForAP); PXUIFieldAttribute.SetVisible <PaymentMethodAccount.aPLastRefNbr>(this.CashAccounts.Cache, null, useForAP); PXUIFieldAttribute.SetVisible <PaymentMethodAccount.aPBatchLastRefNbr>(this.CashAccounts.Cache, null, useForAP); PXUIFieldAttribute.SetVisible <PaymentMethodAccount.useForAR>(this.CashAccounts.Cache, null, useForAR); PXUIFieldAttribute.SetVisible <PaymentMethodAccount.aRIsDefault>(this.CashAccounts.Cache, null, useForAR); PXUIFieldAttribute.SetVisible <PaymentMethodAccount.aRAutoNextNbr>(this.CashAccounts.Cache, null, useForAR); PXUIFieldAttribute.SetVisible <PaymentMethodAccount.aRLastRefNbr>(this.CashAccounts.Cache, null, useForAR); PXUIFieldAttribute.SetVisible <PaymentMethodAccount.aRIsDefaultForRefund>(this.CashAccounts.Cache, null, useForAR); bool showProcCenters = (row.ARIsProcessingRequired == true); this.ProcessingCenters.Cache.AllowDelete = showProcCenters; this.ProcessingCenters.Cache.AllowUpdate = showProcCenters; this.ProcessingCenters.Cache.AllowInsert = showProcCenters; PXResultset <CCProcessingCenterPmntMethod> currDefaultProcCenter = DefaultProcCenter.Select(); if (row.ARIsProcessingRequired == true && currDefaultProcCenter.Count == 0) { PaymentMethod.Cache.RaiseExceptionHandling <PaymentMethod.aRIsProcessingRequired>(row, row.ARIsProcessingRequired, new PXSetPropertyException(Messages.NoProcCenterSetAsDefault, PXErrorLevel.Warning)); } else { PXFieldState state = (PXFieldState)cache.GetStateExt <PaymentMethod.aRIsProcessingRequired>(row); if (state.IsWarning && String.Equals(state.Error, Messages.NoProcCenterSetAsDefault)) { PaymentMethod.Cache.RaiseExceptionHandling <PaymentMethod.aRIsProcessingRequired>(row, null, null); } } }
protected virtual void IIProductLine_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { IIProductLine cfg = e.Row as IIProductLine; if ((cfg == null) || (cfg.ProductLineID == null)) { return; } PXResultset <IIProductLineFilter> rsFilters = PXSelect <IIProductLineFilter, Where <IIProductLineFilter.productLineID, Equal <Current <IIProductLine.productLineID> > >, OrderBy <Asc <IIProductLineFilter.sortOrder> > > .Select(this, cfg.ProductLineID); cfg.UnboundColumn1 = (rsFilters?.Count >= 1) ? rsFilters.RowCast <IIProductLineFilter>()?.ElementAt(0)?.FilterID : null; string unboundColumn1 = (rsFilters?.Count >= 1) ? rsFilters.RowCast <IIProductLineFilter>()?.ElementAt(0)?.Descr : null; cfg.UnboundColumn2 = (rsFilters?.Count >= 2) ? rsFilters.RowCast <IIProductLineFilter>()?.ElementAt(1)?.FilterID : null; string unboundColumn2 = (rsFilters?.Count >= 2) ? rsFilters.RowCast <IIProductLineFilter>()?.ElementAt(1)?.Descr : null; cfg.UnboundColumn3 = (rsFilters?.Count >= 3) ? rsFilters.RowCast <IIProductLineFilter>()?.ElementAt(2)?.FilterID : null; string unboundColumn3 = (rsFilters?.Count >= 3) ? rsFilters.RowCast <IIProductLineFilter>()?.ElementAt(2)?.Descr : null; cfg.UnboundColumn4 = (rsFilters?.Count >= 4) ? rsFilters.RowCast <IIProductLineFilter>()?.ElementAt(3)?.FilterID : null; string unboundColumn4 = (rsFilters?.Count >= 4) ? rsFilters.RowCast <IIProductLineFilter>()?.ElementAt(3)?.Descr : null; cfg.UnboundColumn5 = (rsFilters?.Count >= 5) ? rsFilters.RowCast <IIProductLineFilter>()?.ElementAt(4)?.FilterID : null; string unboundColumn5 = (rsFilters?.Count >= 5) ? rsFilters.RowCast <IIProductLineFilter>()?.ElementAt(4)?.Descr : null; cfg.UnboundColumn6 = (rsFilters?.Count >= 6) ? rsFilters.RowCast <IIProductLineFilter>()?.ElementAt(5)?.FilterID : null; string unboundColumn6 = (rsFilters?.Count >= 6) ? rsFilters.RowCast <IIProductLineFilter>()?.ElementAt(5)?.Descr : null; cfg.UnboundColumn7 = (rsFilters?.Count >= 7) ? rsFilters.RowCast <IIProductLineFilter>()?.ElementAt(6)?.FilterID : null; string unboundColumn7 = (rsFilters?.Count >= 7) ? rsFilters.RowCast <IIProductLineFilter>()?.ElementAt(6)?.Descr : null; cfg.UnboundColumn8 = (rsFilters?.Count >= 8) ? rsFilters.RowCast <IIProductLineFilter>()?.ElementAt(7)?.FilterID : null; string unboundColumn8 = (rsFilters?.Count >= 8) ? rsFilters.RowCast <IIProductLineFilter>()?.ElementAt(7)?.Descr : null; cfg.UnboundColumn9 = (rsFilters?.Count >= 9) ? rsFilters.RowCast <IIProductLineFilter>()?.ElementAt(8)?.FilterID : null; string unboundColumn9 = (rsFilters?.Count >= 9) ? rsFilters.RowCast <IIProductLineFilter>()?.ElementAt(8)?.Descr : null; PXUIFieldAttribute.SetDisplayName <ItemPickerMapping.unboundValueColumn1>(this.ItemPickerMappings.Cache, unboundColumn1); PXUIFieldAttribute.SetVisible <ItemPickerMapping.unboundValueColumn1>(this.ItemPickerMappings.Cache, null, (cfg.UnboundColumn1 != null)); PXUIFieldAttribute.SetDisplayName <ItemPickerMapping.unboundValueColumn2>(this.ItemPickerMappings.Cache, unboundColumn2); PXUIFieldAttribute.SetVisible <ItemPickerMapping.unboundValueColumn2>(this.ItemPickerMappings.Cache, null, (cfg.UnboundColumn2 != null)); PXUIFieldAttribute.SetDisplayName <ItemPickerMapping.unboundValueColumn3>(this.ItemPickerMappings.Cache, unboundColumn3); PXUIFieldAttribute.SetVisible <ItemPickerMapping.unboundValueColumn3>(this.ItemPickerMappings.Cache, null, (cfg.UnboundColumn3 != null)); PXUIFieldAttribute.SetDisplayName <ItemPickerMapping.unboundValueColumn4>(this.ItemPickerMappings.Cache, unboundColumn4); PXUIFieldAttribute.SetVisible <ItemPickerMapping.unboundValueColumn4>(this.ItemPickerMappings.Cache, null, (cfg.UnboundColumn4 != null)); PXUIFieldAttribute.SetDisplayName <ItemPickerMapping.unboundValueColumn5>(this.ItemPickerMappings.Cache, unboundColumn5); PXUIFieldAttribute.SetVisible <ItemPickerMapping.unboundValueColumn5>(this.ItemPickerMappings.Cache, null, (cfg.UnboundColumn5 != null)); PXUIFieldAttribute.SetDisplayName <ItemPickerMapping.unboundValueColumn6>(this.ItemPickerMappings.Cache, unboundColumn6); PXUIFieldAttribute.SetVisible <ItemPickerMapping.unboundValueColumn6>(this.ItemPickerMappings.Cache, null, (cfg.UnboundColumn6 != null)); PXUIFieldAttribute.SetDisplayName <ItemPickerMapping.unboundValueColumn7>(this.ItemPickerMappings.Cache, unboundColumn7); PXUIFieldAttribute.SetVisible <ItemPickerMapping.unboundValueColumn7>(this.ItemPickerMappings.Cache, null, (cfg.UnboundColumn7 != null)); PXUIFieldAttribute.SetDisplayName <ItemPickerMapping.unboundValueColumn8>(this.ItemPickerMappings.Cache, unboundColumn8); PXUIFieldAttribute.SetVisible <ItemPickerMapping.unboundValueColumn8>(this.ItemPickerMappings.Cache, null, (cfg.UnboundColumn8 != null)); PXUIFieldAttribute.SetDisplayName <ItemPickerMapping.unboundValueColumn9>(this.ItemPickerMappings.Cache, unboundColumn9); PXUIFieldAttribute.SetVisible <ItemPickerMapping.unboundValueColumn9>(this.ItemPickerMappings.Cache, null, (cfg.UnboundColumn9 != null)); }
protected override void TMain_RowSelected(PXCache cache, PXRowSelectedEventArgs e) { _Graph.Actions["DeleteAction"].SetEnabled(_Graph.Views["CampaignMembers"].SelectSingle(Array.Empty <object>()) != null); }
protected virtual void AccountsFilter_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { PXUIFieldAttribute.SetEnabled <AccountsFilter.bAccountID>(sender, e.Row, !this.IsDimensionAutonumbered(CustomerAttribute.DimensionName)); }
protected virtual void SOOrderType_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { if (e.Row == null) { return; } SOOrderType ordertype = (SOOrderType)e.Row; SOOrderType link = references.SelectWindowed(0, 1, ordertype.OrderType); bool isTemplateUpdatable = ordertype.IsSystem == false && link == null && ordertype.OrderType != null; PXUIFieldAttribute.SetEnabled <SOOrderType.template>(sender, e.Row, isTemplateUpdatable); SOOrderTypeOperation def = this.defaultOperation.Select(ordertype.OrderType, ordertype.DefaultOperation); if (def == null) { def = new SOOrderTypeOperation(); } PXUIFieldAttribute.SetEnabled <SOOrderType.billSeparately>(sender, e.Row, ordertype.ARDocType != ARDocType.NoUpdate); PXUIFieldAttribute.SetEnabled <SOOrderType.invoiceNumberingID>(sender, e.Row, ordertype.ARDocType != ARDocType.NoUpdate); if (ordertype.ARDocType == ARDocType.NoUpdate) { INTranType.CustomListAttribute listattr = new INTranType.SONonARListAttribute(); PXStringListAttribute.SetList <SOOrderTypeOperation.iNDocType>(this.operations.Cache, null, listattr.AllowedValues, listattr.AllowedLabels); } else { INTranType.CustomListAttribute listattr = new INTranType.SOListAttribute(); PXStringListAttribute.SetList <SOOrderTypeOperation.iNDocType>(this.operations.Cache, null, listattr.AllowedValues, listattr.AllowedLabels); } SOOrder order = PXSelectJoin <SOOrder, InnerJoin <INItemPlan, On <INItemPlan.refNoteID, Equal <SOOrder.noteID> > >, Where <SOOrder.orderType, Equal <Required <SOOrder.orderType> >, And <Where <INItemPlan.planType, Equal <INPlanConstants.plan60>, Or <INItemPlan.planType, Equal <INPlanConstants.plan66>, Or <INItemPlan.planType, Equal <INPlanConstants.plan68> > > > > > > .SelectWindowed(this, 0, 1, ordertype.OrderType); //PXUIFieldAttribute.SetEnabled<SOOrderType.requireLocation>(sender, ordertype, order == null && isTemplateUpdatable); //PXUIFieldAttribute.SetEnabled<SOOrderType.requireLocation>(sender, e.Row, def.INDocType != INTranType.NoUpdate && isTemplateUpdatable); PXUIFieldAttribute.SetEnabled <SOOrderType.requireShipping>(sender, e.Row, def.INDocType != INTranType.NoUpdate && def.INDocType != INTranType.Transfer && isTemplateUpdatable); PXUIFieldAttribute.SetEnabled <SOOrderType.aRDocType>(sender, e.Row, def.INDocType != INTranType.Transfer && isTemplateUpdatable); PXUIFieldAttribute.SetEnabled <SOOrderType.behavior>(sender, e.Row, isTemplateUpdatable); PXUIFieldAttribute.SetEnabled <SOOrderType.defaultOperation>(sender, e.Row, isTemplateUpdatable && ordertype.Behavior == SOBehavior.RM); PXUIFieldAttribute.SetVisible <SOOrderTypeOperation.active>(operations.Cache, null, ordertype.Behavior == SOBehavior.RM || ordertype.Behavior == SOBehavior.IN); PXUIFieldAttribute.SetVisible <SOOrderTypeOperation.autoCreateIssueLine>(operations.Cache, null, ordertype.Behavior == SOBehavior.RM); PXUIFieldAttribute.SetEnabled <SOOrderType.copyLineNotesToInvoiceOnlyNS>(sender, ordertype, ordertype.CopyLineNotesToInvoice == true); PXUIFieldAttribute.SetEnabled <SOOrderType.copyLineFilesToInvoiceOnlyNS>(sender, ordertype, ordertype.CopyLineFilesToInvoice == true); PXUIFieldAttribute.SetEnabled <SOOrderType.requireAllocation>(sender, ordertype, ordertype.RequireShipping == true); PXUIFieldAttribute.SetEnabled <SOOrderType.requireLotSerial>(sender, ordertype, ordertype.RequireShipping == true); PXUIFieldAttribute.SetEnabled <SOOrderType.copyLotSerialFromShipment>(sender, ordertype, ordertype.RequireShipping == true); PXUIFieldAttribute.SetEnabled <SOOrderType.useDiscountSubFromSalesSub>(sender, ordertype, ordertype.PostLineDiscSeparately == true); PXUIFieldAttribute.SetVisible <SOOrderType.recalculateDiscOnPartialShipment>(sender, e.Row, PXAccess.FeatureInstalled <FeaturesSet.inventory>() && PXAccess.FeatureInstalled <FeaturesSet.customerDiscounts>()); bool allowUserDefinedOrderTypes = PXAccess.FeatureInstalled <FeaturesSet.userDefinedOrderTypes>(); soordertype.AllowInsert = allowUserDefinedOrderTypes; currentordertype.AllowInsert = allowUserDefinedOrderTypes; bool allowUpdateOrderTypes = allowUserDefinedOrderTypes || sender.GetStatus(e.Row) != PXEntryStatus.Inserted; soordertype.AllowUpdate = allowUpdateOrderTypes; currentordertype.AllowUpdate = allowUpdateOrderTypes; PXUIFieldAttribute.SetVisible <SOOrderType.commitmentTracking>(sender, e.Row, CommitmentTracking); if (!PXAccess.FeatureInstalled <FeaturesSet.inventory>()) { PXDefaultAttribute.SetDefault <SOOrderType.behavior>(sender, SOBehavior.IN); PXStringListAttribute.SetList <SOOrderType.behavior>(sender, null, new string[] { SOBehavior.IN, SOBehavior.QT, SOBehavior.CM }, new string[] { Messages.INName, Messages.QTName, Messages.CMName }); } }
protected virtual void FSServiceTemplateDetService_RowSelected(PXCache cache, PXRowSelectedEventArgs e) { if (e.Row == null) { return; } FSServiceTemplateDetService fsServiceTemplateDetServiceRow = (FSServiceTemplateDetService)e.Row; LineTypeBlankFields(fsServiceTemplateDetServiceRow); LineTypeEnableDisable(cache, fsServiceTemplateDetServiceRow); }
protected virtual void Parameters_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { SetProcessDelegate <ScheduleProcess>(this, (Parameters)e.Row, Schedule_List); }
protected virtual void RouteAppointmentForecastingFilter_RowSelected(PXCache cache, PXRowSelectedEventArgs e) { if (e.Row == null) { return; } generateProjection.SetEnabled(RouteAppointmentForecastingFilter.Current.DateBegin != null && RouteAppointmentForecastingFilter.Current.DateEnd != null); }
protected virtual void CampaignOperationParam_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { PXUIFieldAttribute.SetVisible <CRCampaignMembers.status>(Caches[typeof(CRCampaignMembers)], null, Operations.Current.Action != CampaignOperationParam.ActionList.Add); }
protected virtual void SOOrderType_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { if (e.Row == null) { return; } SOOrderType ordertype = (SOOrderType)e.Row; SOOrderType link = references.SelectWindowed(0, 1, ordertype.OrderType); PXUIFieldAttribute.SetEnabled <SOOrderType.template>(sender, e.Row, link == null); bool isTemplateUpdatable = link == null && ordertype.OrderType != null && (ordertype.OrderType == ordertype.Template || ordertype.Template == null); SOOrderTypeOperation def = this.defaultOperation.Select(ordertype.OrderType, ordertype.DefaultOperation); if (def == null) { def = new SOOrderTypeOperation(); } PXUIFieldAttribute.SetEnabled <SOOrderType.billSeparately>(sender, e.Row, ordertype.ARDocType != ARDocType.NoUpdate); PXUIFieldAttribute.SetEnabled <SOOrderType.invoiceNumberingID>(sender, e.Row, ordertype.ARDocType != ARDocType.NoUpdate); if (ordertype.ARDocType == ARDocType.NoUpdate) { INTranType.CustomListAttribute listattr = new INTranType.SONonARListAttribute(); PXStringListAttribute.SetList <SOOrderTypeOperation.iNDocType>(this.operations.Cache, null, listattr.AllowedValues, listattr.AllowedLabels); } else { INTranType.CustomListAttribute listattr = new INTranType.SOListAttribute(); PXStringListAttribute.SetList <SOOrderTypeOperation.iNDocType>(this.operations.Cache, null, listattr.AllowedValues, listattr.AllowedLabels); } SOOrder order = PXSelectJoin <SOOrder, InnerJoin <INItemPlan, On <INItemPlan.refNoteID, Equal <SOOrder.noteID> > >, Where <SOOrder.orderType, Equal <Required <SOOrder.orderType> >, And <Where <INItemPlan.planType, Equal <INPlanConstants.plan60>, Or <INItemPlan.planType, Equal <INPlanConstants.plan66>, Or <INItemPlan.planType, Equal <INPlanConstants.plan68> > > > > > > .SelectWindowed(this, 0, 1, ordertype.OrderType); //PXUIFieldAttribute.SetEnabled<SOOrderType.requireLocation>(sender, ordertype, order == null && isTemplateUpdatable); //PXUIFieldAttribute.SetEnabled<SOOrderType.requireLocation>(sender, e.Row, def.INDocType != INTranType.NoUpdate && isTemplateUpdatable); PXUIFieldAttribute.SetEnabled <SOOrderType.requireShipping>(sender, e.Row, def.INDocType != INTranType.NoUpdate && def.INDocType != INTranType.Transfer && isTemplateUpdatable); PXUIFieldAttribute.SetEnabled <SOOrderType.aRDocType>(sender, e.Row, def.INDocType != INTranType.Transfer && isTemplateUpdatable); PXUIFieldAttribute.SetEnabled <SOOrderType.behavior>(sender, e.Row, isTemplateUpdatable); PXUIFieldAttribute.SetEnabled <SOOrderType.defaultOperation>(sender, e.Row, isTemplateUpdatable && ordertype.Behavior == SOBehavior.RM); PXUIFieldAttribute.SetVisible <SOOrderTypeOperation.active>(operations.Cache, null, ordertype.Behavior == SOBehavior.RM || ordertype.Behavior == SOBehavior.IN); PXUIFieldAttribute.SetVisible <SOOrderTypeOperation.autoCreateIssueLine>(operations.Cache, null, ordertype.Behavior == SOBehavior.RM); PXPersistingCheck activeCheck = ordertype.Active == true ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing; PXDefaultAttribute.SetPersistingCheck <SOOrderType.salesSubMask>(sender, ordertype, activeCheck); //PXDefaultAttribute.SetPersistingCheck<SOOrderType.cOGSSubMask>(sender, ordertype, activeCheck); PXDefaultAttribute.SetPersistingCheck <SOOrderType.miscSubMask>(sender, ordertype, activeCheck); PXDefaultAttribute.SetPersistingCheck <SOOrderType.freightSubMask>(sender, ordertype, activeCheck); PXDefaultAttribute.SetPersistingCheck <SOOrderType.discSubMask>(sender, ordertype, activeCheck); PXDefaultAttribute.SetPersistingCheck <SOOrderType.freightAcctID>(sender, ordertype, activeCheck); PXDefaultAttribute.SetPersistingCheck <SOOrderType.freightSubID>(sender, ordertype, activeCheck); PXUIFieldAttribute.SetEnabled <SOOrderType.copyLineNotesToInvoiceOnlyNS>(sender, ordertype, ordertype.CopyLineNotesToInvoice == true); PXUIFieldAttribute.SetEnabled <SOOrderType.copyLineFilesToInvoiceOnlyNS>(sender, ordertype, ordertype.CopyLineFilesToInvoice == true); PXUIFieldAttribute.SetEnabled <SOOrderType.requireAllocation>(sender, ordertype, ordertype.RequireShipping == true); PXUIFieldAttribute.SetEnabled <SOOrderType.requireLotSerial>(sender, ordertype, ordertype.RequireShipping == true); PXUIFieldAttribute.SetEnabled <SOOrderType.copyLotSerialFromShipment>(sender, ordertype, ordertype.RequireShipping == true); PXUIFieldAttribute.SetEnabled <SOOrderType.useDiscountSubFromSalesSub>(sender, ordertype, ordertype.PostLineDiscSeparately == true); bool allowUserDefinedOrderTypes = PXAccess.FeatureInstalled <FeaturesSet.userDefinedOrderTypes>(); soordertype.AllowInsert = allowUserDefinedOrderTypes; currentordertype.AllowInsert = allowUserDefinedOrderTypes; bool allowUpdateOrderTypes = allowUserDefinedOrderTypes || sender.GetStatus(e.Row) != PXEntryStatus.Inserted; soordertype.AllowUpdate = allowUpdateOrderTypes; currentordertype.AllowUpdate = allowUpdateOrderTypes; }
public virtual void BranchBAccount_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { UpdateRUTROTControlsState(); }
public virtual void ARStatementCycle_RowSelected(PXCache cache, PXRowSelectedEventArgs e) { if (e.Row == null) { return; } ARStatementCycle row = (ARStatementCycle)e.Row; if (row.NextStmtDate.HasValue == false) { DateTime basisDate = row.LastStmtDate.HasValue? row.LastStmtDate.Value: Accessinfo.BusinessDate.HasValue? Accessinfo.BusinessDate.Value: DateTime.Now; row.NextStmtDate = CalcNextStatementDate(basisDate, row.PrepareOn, row.Day00, row.Day01); } ARSetup setup = this.ARSetup.Select(); cache.GetAttributes(e.Row, null); if (setup.DefFinChargeFromCycle ?? false) { bool?hasOverdueInvoices = null; bool hasUnAppliedPayments = false; bool hasChargeableInvoices = false; if (row.RequirePaymentApplication ?? false) { hasOverdueInvoices = CheckForOverdueInvoices(this, row.StatementCycleId, row.NextStmtDate.Value); if (hasOverdueInvoices.Value) { if (CheckForOpenPayments(this, row.StatementCycleId)) { hasUnAppliedPayments = true; } } } if ((row.FinChargeApply ?? false) && (row.RequireFinChargeProcessing ?? false)) { if (!hasOverdueInvoices.HasValue) { hasOverdueInvoices = CheckForOverdueInvoices(this, row.StatementCycleId, row.NextStmtDate.Value); } if (hasOverdueInvoices.Value && (!row.LastFinChrgDate.HasValue || row.LastFinChrgDate.Value < row.NextStmtDate.Value)) { hasChargeableInvoices = true; } } if (hasChargeableInvoices && hasUnAppliedPayments) { this.CyclesList.Cache.RaiseExceptionHandling <ARStatementCycle.statementCycleId>(row, row.StatementCycleId, new PXSetPropertyException(Messages.WRN_ProcessStatementDetectsOverdueInvoicesAndUnappliedPayments, PXErrorLevel.RowWarning)); } else { if (hasChargeableInvoices) { this.CyclesList.Cache.RaiseExceptionHandling <ARStatementCycle.statementCycleId>(row, row.StatementCycleId, new PXSetPropertyException(Messages.WRN_ProcessStatementDetectsOverdueInvoices, PXErrorLevel.RowWarning)); } if (hasUnAppliedPayments) { this.CyclesList.Cache.RaiseExceptionHandling <ARStatementCycle.statementCycleId>(row, row.StatementCycleId, new PXSetPropertyException(Messages.WRN_ProcessStatementDetectsUnappliedPayments, PXErrorLevel.RowWarning)); } } } }
protected virtual void Contact_RowSelected(PXCache sender, PXRowSelectedEventArgs e) { Contact row = e.Row as Contact; if (row == null) { return; } var isNotInserted = sender.GetStatus(row) != PXEntryStatus.Inserted; Contact.AllowDelete = row.ContactType == ContactTypesAttribute.Person; PXUIFieldAttribute.SetEnabled <Contact.isActive>(Contact.Cache, row, row.ContactType == ContactTypesAttribute.Person); PXUIFieldAttribute.SetEnabled <Contact.classID>(Contact.Cache, row, row.ContactType == ContactTypesAttribute.Person); PXUIFieldAttribute.SetEnabled <Contact.isAddressSameAsMain>(Contact.Cache, row, row.ContactType == ContactTypesAttribute.Person); copyBAccountContactInfo.SetEnabled(row.ContactType == ContactTypesAttribute.Person); Answers.Cache.AllowInsert = row.ContactType == ContactTypesAttribute.Person; Answers.Cache.AllowUpdate = row.ContactType == ContactTypesAttribute.Person; Answers.Cache.AllowDelete = row.ContactType == ContactTypesAttribute.Person; Activities.Cache.AllowInsert = row.ContactType == ContactTypesAttribute.Person; Activities.Cache.AllowUpdate = row.ContactType == ContactTypesAttribute.Person; Activities.Cache.AllowDelete = row.ContactType == ContactTypesAttribute.Person; Relations.Cache.AllowInsert = row.ContactType == ContactTypesAttribute.Person && isNotInserted; Relations.Cache.AllowUpdate = row.ContactType == ContactTypesAttribute.Person; Relations.Cache.AllowDelete = row.ContactType == ContactTypesAttribute.Person; Opportunities.Cache.AllowInsert = row.ContactType == ContactTypesAttribute.Person && isNotInserted; Opportunities.Cache.AllowUpdate = row.ContactType == ContactTypesAttribute.Person; Opportunities.Cache.AllowDelete = row.ContactType == ContactTypesAttribute.Person; Cases.Cache.AllowInsert = row.ContactType == ContactTypesAttribute.Person && isNotInserted; Cases.Cache.AllowUpdate = row.ContactType == ContactTypesAttribute.Person; Cases.Cache.AllowDelete = row.ContactType == ContactTypesAttribute.Person; Members.Cache.AllowInsert = row.ContactType == ContactTypesAttribute.Person && isNotInserted; Members.Cache.AllowUpdate = row.ContactType == ContactTypesAttribute.Person; Members.Cache.AllowDelete = row.ContactType == ContactTypesAttribute.Person; Subscriptions.Cache.AllowInsert = row.ContactType == ContactTypesAttribute.Person && isNotInserted; Subscriptions.Cache.AllowUpdate = row.ContactType == ContactTypesAttribute.Person; Subscriptions.Cache.AllowDelete = row.ContactType == ContactTypesAttribute.Person; NWatchers.Cache.AllowInsert = row.ContactType == ContactTypesAttribute.Person && isNotInserted; NWatchers.Cache.AllowUpdate = row.ContactType == ContactTypesAttribute.Person; NWatchers.Cache.AllowDelete = row.ContactType == ContactTypesAttribute.Person; User.Cache.AllowInsert = row.ContactType == ContactTypesAttribute.Person; User.Cache.AllowUpdate = row.ContactType == ContactTypesAttribute.Person; User.Cache.AllowDelete = row.ContactType == ContactTypesAttribute.Person; User.Cache.AllowSelect = row.ContactType == ContactTypesAttribute.Person; User.Cache.ClearQueryCache(); Roles.Cache.AllowInsert = row.ContactType == ContactTypesAttribute.Person; Roles.Cache.AllowUpdate = row.ContactType == ContactTypesAttribute.Person; Roles.Cache.AllowDelete = row.ContactType == ContactTypesAttribute.Person; Roles.Cache.AllowSelect = row.ContactType == ContactTypesAttribute.Person; Roles.Cache.ClearQueryCache(); UserRoles.Cache.AllowInsert = row.ContactType == ContactTypesAttribute.Person; UserRoles.Cache.AllowUpdate = row.ContactType == ContactTypesAttribute.Person; UserRoles.Cache.AllowDelete = row.ContactType == ContactTypesAttribute.Person; UserRoles.Cache.AllowSelect = row.ContactType == ContactTypesAttribute.Person; UserRoles.Cache.ClearQueryCache(); var bAccount = row.BAccountID. With <int?, BAccount>(_ => (BAccount)PXSelect <BAccount, Where <BAccount.bAccountID, Equal <Required <BAccount.bAccountID> > > > . Select(this, _)); var isCustomerOrProspect = bAccount == null || bAccount.Type == BAccountType.CustomerType || bAccount.Type == BAccountType.ProspectType || bAccount.Type == BAccountType.CombinedType; addOpportunity.SetEnabled(isNotInserted && isCustomerOrProspect); addCase.SetEnabled(isNotInserted && isCustomerOrProspect); PXUIFieldAttribute.SetEnabled <Contact.contactID>(sender, row, true); PXUIFieldAttribute.SetEnabled <Contact.bAccountID>(sender, row, row.ContactType == ContactTypesAttribute.Person); CRContactClass contactClass = row.ClassID. With(_ => (CRContactClass)PXSelectReadonly <CRContactClass, Where <CRContactClass.classID, Equal <Required <CRContactClass.classID> > > > . Select(this, _)); if (contactClass != null) { Activities.DefaultEMailAccountId = contactClass.DefaultEMailAccountID; } bool isUserInserted = row.UserID == null || User.Cache.GetStatus(User.Current) == PXEntryStatus.Inserted; bool hasLoginType = isUserInserted && User.Current != null && User.Current.LoginTypeID != null; PXUIFieldAttribute.SetEnabled <Users.loginTypeID>(User.Cache, User.Current, isUserInserted && row.IsActive == true); PXUIFieldAttribute.SetEnabled <Users.username>(User.Cache, User.Current, this.IsContractBasedAPI || hasLoginType); PXUIFieldAttribute.SetEnabled <Users.generatePassword>(User.Cache, User.Current, this.IsContractBasedAPI || hasLoginType); PXUIFieldAttribute.SetEnabled <Users.password>(User.Cache, User.Current, this.IsContractBasedAPI || (hasLoginType && User.Current.GeneratePassword != true)); var employeeHasUserAttached = row.ContactType == ContactTypesAttribute.Employee && User.Current != null; PXDefaultAttribute.SetPersistingCheck <Contact.eMail>(sender, row, employeeHasUserAttached || (hasLoginType && User.Current.Username != null) ? PXPersistingCheck.NullOrBlank : PXPersistingCheck.Nothing); PXUIFieldAttribute.SetRequired <Contact.eMail>(sender, employeeHasUserAttached || (hasLoginType && User.Current.Username != null)); User.Current = (Users)User.View.SelectSingleBound(new[] { e.Row }); if (row.DuplicateStatus == DuplicateStatusAttribute.PossibleDuplicated || row.DuplicateFound == true) { sender.RaiseExceptionHandling <Contact.duplicateStatus>(row, null, new PXSetPropertyException(Messages.ContactHavePossibleDuplicates, PXErrorLevel.Warning, row.ContactID)); } }