public void FieldVerifying(PX.Data.PXCache sender, PX.Data.PXFieldVerifyingEventArgs e) { if (e.NewValue == null || !((string)e.NewValue).StartsWith("BOB-")) { throw new PXSetPropertyException("Serial Number must start with BOB-"); } }
public override void FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e) { if (object.Equals(DRScheduleDetail.EmptyComponentID, e.NewValue)) return; base.FieldVerifying(sender, e); }
protected virtual void Customer_AcctCD_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e) { if(PXSelectorAttribute.Select<Customer.acctCD>(sender, e.Row, e.NewValue) == null) { throw new PXSetPropertyException(ErrorMessages.ElementDoesntExist, "CustomerID"); } }
public void FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e) { CurrencyInfo info = e.Row as CurrencyInfo; if (info != null) { CMSetup CMSetup = info.getCMSetup(sender); //if (CMSetup != null && (bool)CMSetup.MCActivated) //{ // if (info.ModuleCode == "AP" && CMSetup.APCuryOverride != true || // info.ModuleCode == "AR" && CMSetup.ARCuryOverride != true) // { // object newValue; // sender.RaiseFieldDefaulting<CurrencyInfo.curyID>(e.Row, out newValue); // if (!object.Equals(newValue, e.NewValue)) // { // throw new PXSetPropertyException(Messages.CuryIDCannotBeChanged, "CuryID"); // } // } //} } }
protected virtual void InventoryItem_InventoryCD_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e) { if (PXSelectorAttribute.Select<InventoryItem.inventoryCD>(sender, e.Row, e.NewValue) == null) { throw new PXSetPropertyException(ErrorMessages.ElementDoesntExist, "InventoryCD"); } }
public override void FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e) { }
protected virtual void SOOrderShipment_ShipmentNbr_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e) { e.Cancel = true; }
protected override void ARAdjust_CuryAdjdAmt_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e) { ARAdjust adj = (ARAdjust)e.Row; Terms terms = PXSelect<Terms, Where<Terms.termsID, Equal<Current<ARInvoice.termsID>>>>.Select(this); if (terms != null && terms.InstallmentType != TermsInstallmentType.Single && (decimal)e.NewValue > 0m) { throw new PXSetPropertyException(AR.Messages.PrepaymentAppliedToMultiplyInstallments); } if (adj.CuryDocBal == null) { PXResult<ARPayment, CurrencyInfo> res = (PXResult<ARPayment, CurrencyInfo>)PXSelectReadonly2<ARPayment, InnerJoin<CurrencyInfo, On<CurrencyInfo.curyInfoID, Equal<ARPayment.curyInfoID>>>, Where<ARPayment.docType, Equal<Required<ARPayment.docType>>, And<ARPayment.refNbr, Equal<Required<ARPayment.refNbr>>>>>.Select(this, adj.AdjgDocType, adj.AdjgRefNbr); ARPayment payment = PXCache<ARPayment>.CreateCopy(res); CurrencyInfo pay_info = (CurrencyInfo)res; CurrencyInfo inv_info = PXSelect<CurrencyInfo, Where<CurrencyInfo.curyInfoID, Equal<Current<ARInvoice.curyInfoID>>>>.Select(this); ARAdjust other = PXSelectGroupBy<ARAdjust, Where<ARAdjust.adjgDocType, Equal<Required<ARAdjust.adjgDocType>>, And<ARAdjust.adjgRefNbr, Equal<Required<ARAdjust.adjgRefNbr>>, And<ARAdjust.released, Equal<False>, And<Where<ARAdjust.adjdDocType, NotEqual<Required<ARAdjust.adjdDocType>>, Or<ARAdjust.adjdRefNbr, NotEqual<Required<ARAdjust.adjdRefNbr>>>>>>>>, Aggregate<GroupBy<ARAdjust.adjgDocType, GroupBy<ARAdjust.adjgRefNbr, Sum<ARAdjust.curyAdjgAmt, Sum<ARAdjust.adjAmt>>>>>>.Select(this, adj.AdjgDocType, adj.AdjgRefNbr, adj.AdjdDocType, adj.AdjdRefNbr); if (other != null && other.AdjdRefNbr != null) { payment.CuryDocBal -= other.CuryAdjgAmt; payment.DocBal -= other.AdjAmt; } decimal CuryDocBal; if (string.Equals(pay_info.CuryID, inv_info.CuryID)) { CuryDocBal = (decimal)payment.CuryDocBal; } else { PXDBCurrencyAttribute.CuryConvCury(sender, inv_info, (decimal)payment.DocBal, out CuryDocBal); } adj.CuryDocBal = CuryDocBal - adj.CuryAdjdAmt; } if ((decimal)adj.CuryDocBal + (decimal)adj.CuryAdjdAmt - (decimal)e.NewValue < 0) { throw new PXSetPropertyException(AR.Messages.Entry_LE, ((decimal)adj.CuryDocBal + (decimal)adj.CuryAdjdAmt).ToString()); } }
protected virtual void SOInvoice_CuryDiscTot_FieldVerifying(PXCache sender, PXFieldVerifyingEventArgs e) { SOInvoice row = e.Row as SOInvoice; if (row.CuryLineTotal + row.CuryMiscTot >= 0m && row.CuryLineTotal + row.CuryMiscTot < Convert.ToDecimal(e.NewValue)) { throw new PXSetPropertyException(CS.Messages.Entry_LE, (row.CuryLineTotal + row.CuryMiscTot).ToString()); } if (row.CuryLineTotal + row.CuryMiscTot < 0m && row.CuryLineTotal + row.CuryMiscTot > Convert.ToDecimal(e.NewValue)) { throw new PXSetPropertyException(CS.Messages.Entry_GE, (row.CuryLineTotal + row.CuryMiscTot).ToString()); } }