protected virtual void CRMergeMethod_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { var row = e.Row as CRMergeMethod; var oldRow = e.OldRow as CRMergeMethod; if (row == null || oldRow == null) { return; } if (row.DataField != oldRow.DataField) { object defaultMethod; sender.RaiseFieldDefaulting <CRMergeMethod.method>(row, out defaultMethod); row.Method = (int?)defaultMethod; } }
protected virtual void CRMerge_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { var row = e.Row as CRMerge; var oldRow = e.OldRow as CRMerge; if (row == null || oldRow == null) { return; } if (row.EntityType != oldRow.EntityType) { RemoveAllCriteria(row); RemoveAllMethods(row); InsertMethods(row); } }
protected virtual void TaxAdjustment_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { var doc = e.Row as TaxAdjustment; if (doc == null) { return; } if (doc.Hold != true && doc.Released != true) { sender.RaiseExceptionHandling <TaxAdjustment.curyOrigDocAmt>(e.Row, ((TaxAdjustment)e.Row).CuryOrigDocAmt, ((TaxAdjustment)e.Row).CuryDocBal != ((TaxAdjustment)e.Row).CuryOrigDocAmt ? new PXSetPropertyException(Messages.DocumentOutOfBalance) : null); } }
protected override void CurrencyInfo_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { TaxCalc taxCalc = CurrentDocument.TaxCalc ?? TaxCalc.NoCalc; if (taxCalc == TaxCalc.Calc || taxCalc == TaxCalc.ManualLineCalc) { if (e.Row != null && ((CurrencyInfo)e.Row).CuryRate != null && (e.OldRow == null || !sender.ObjectsEqual <CurrencyInfo.curyRate, CurrencyInfo.curyMultDiv>(e.Row, e.OldRow))) { if (Base.AppointmentDetServices.SelectSingle() != null || Base.AppointmentDetParts.SelectSingle() != null || Base.PickupDeliveryItems.SelectSingle() != null) { CalcTaxes(null); } } } }
protected virtual void RQRequestClass_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { RQRequestClass row = (RQRequestClass)e.Row; if (row == null) { return; } if (row.VendorNotRequest == true) { row.VendorMultiply = false; } if (row.RestrictItemList == true) { row.HideInventoryID = false; } }
protected virtual void Segment_RowUpdated(PXCache cache, PXRowUpdatedEventArgs e) { Segment seg = (Segment)e.Row; if (seg == null) { return; } if (seg.ParentDimensionID != null) { seg.Inherited = false; } UpdateHeader(e.Row); CheckLength(Header.Cache, Header.Current); }
protected virtual void POSetup_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { POSetup row = (POSetup)e.Row; if (row != null) { if (row.CopyLineDescrSO == false) { row.CopyLineNoteSO = false; } } if (!sender.ObjectsEqual <POSetup.changeCuryRateOnReceipt>(e.Row, e.OldRow)) { PX.Common.PXPageCacheUtils.InvalidateCachedPages(); } }
public virtual void CustomerPaymentProfile_RowUpdated(PXCache cache, PXRowUpdatedEventArgs e) { CustomerPaymentProfile row = e.Row as CustomerPaymentProfile; if (row?.Selected == true) { foreach (CCSynchronizeCard syncCard in GetRecordsWithSameCustomerCCPID(row.PCCustomerID)) { if (syncCard.RecordID == row.RecordID && !syncCard.BAccountID.HasValue) { syncCard.BAccountID = row.BAccountID; CustomerCardPaymentData.Update(syncCard); CustomerCardPaymentData.View.RequestRefresh(); } } } }
/// <summary> /// This event handler is a workaround for Kensium tests. /// This event handler will be removed in Acumatica 7.0. /// </summary> protected virtual void HiddenInventoryItem_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { var item = (HiddenInventoryItem)e.Row; if (item == null) { return; } HiddenInventoryItemRUTROT itemRR = PXCache <HiddenInventoryItem> .GetExtension <HiddenInventoryItemRUTROT>(item); Base.Item.SetValueExt <InventoryItemRUTROT.rUTROTType>(Base.Item.Current, itemRR.RUTROTType); Base.Item.SetValueExt <InventoryItemRUTROT.rUTROTItemType>(Base.Item.Current, itemRR.RUTROTItemType); Base.Item.SetValueExt <InventoryItemRUTROT.rUTROTWorkTypeID>(Base.Item.Current, itemRR.RUTROTWorkTypeID); Base.Item.Update(Base.Item.Current); }
protected virtual void GLConsolSetup_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { GLConsolSetup setup = (GLConsolSetup)e.Row; if (!sender.ObjectsEqual <GLConsolSetup.sourceLedgerCD>(e.Row, e.OldRow)) { string oldbranchid = (string)sender.GetValue <GLConsolSetup.sourceBranchCD>(e.Row); sender.SetValue <GLConsolSetup.sourceBranchCD>(e.Row, null); GLConsolLedger coledger = PXSelect <GLConsolLedger, Where <GLConsolLedger.setupID, Equal <Current <GLConsolSetup.setupID> >, And <GLConsolLedger.ledgerCD, Equal <Current <GLConsolSetup.sourceLedgerCD> > > > > .Select(this); if (coledger != null && coledger.PostInterCompany == true) { sender.SetValueExt <GLConsolSetup.sourceBranchCD>(e.Row, oldbranchid); } } }
protected virtual void CurrencyInfo_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { foreach (CATransfer doc in PXSelect <CATransfer, Where <CATransfer.outCuryInfoID, Equal <Required <CATransfer.outCuryInfoID> > > > .Select(sender.Graph, ((CurrencyInfo)e.Row).CuryInfoID)) { PXCurrencyAttribute.CalcBaseValues <CATransfer.curyTranOut>(Transfer.Cache, doc); CalculateTranIn(doc); Transfer.Cache.MarkUpdated(doc); } foreach (CATransfer doc in PXSelect <CATransfer, Where <CATransfer.inCuryInfoID, Equal <Required <CATransfer.inCuryInfoID> > > > .Select(sender.Graph, ((CurrencyInfo)e.Row).CuryInfoID)) { CalculateTranIn(doc); Transfer.Cache.MarkUpdated(doc); } }
protected virtual void RelationGroup_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { PX.SM.RelationGroup group = (PX.SM.RelationGroup)e.Row; if (group.SpecificModule != typeof(INSetup).Namespace || group.SpecificType != typeof(SegmentValue).FullName) { PX.SM.RelationGroup existing = PXSelectReadonly <PX.SM.RelationGroup, Where <PX.SM.RelationGroup.groupName, Equal <Required <PX.SM.RelationGroup.groupName> > > > .Select(this, group.GroupName); if (existing != null) { sender.RestoreCopy(group, existing); } group.SpecificModule = typeof(INSetup).Namespace; group.SpecificType = typeof(SegmentValue).FullName; } }
public override void Parent_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { base.Parent_RowUpdated(sender, e); if (!sender.ObjectsEqual <ARRegister.docDate, ARRegister.hold, ARInvoice.creditHold>(e.Row, e.OldRow)) { var tranCache = sender.Graph.Caches <ARTran>(); foreach (ARTran tran in PXSelect <ARTran, Where <ARTran.tranType, Equal <Current <ARRegister.docType> >, And <ARTran.refNbr, Equal <Current <ARRegister.refNbr> >, And <ARTran.lineType, Equal <SOLineType.inventory>, And <ARTran.sOOrderNbr, IsNull, And <ARTran.sOShipmentNbr, IsNull> > > > > > .Select(sender.Graph)) { RaiseRowUpdated(tranCache, tran, tran); } } }
protected virtual void SOShipLine_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e, PXRowUpdated baseHandler) { if (!(e.Row is SOShipLine)) { return; } baseHandler?.Invoke(sender, e); SOShipLine row = e.Row as SOShipLine; SOLine soLine = KCSOLineByLineNbrAndOrderNbr.SelectSingle(row.OrigLineNbr, row.OrigOrderNbr); int? UsrKNMasterLineNbr = soLine?.GetExtension <SOLinePCExt>().UsrKNMasterLineNbr; if (soLine != null && soLine.GetExtension <SOLinePCExt>().UsrKNMasterLineNbr == soLine.LineNbr && row.LocationID == null) { SOShipLine childLine = KCSOLineByMasterLineAndOrderNbr.Select(UsrKNMasterLineNbr, row.OrigOrderNbr).RowCast <SOLine>().Where(x => x.LineNbr != soLine.LineNbr).FirstOrDefault(); SOShipLine childShipLine = Base.Transactions.Select().RowCast <SOShipLine>().Where(x => x.OrigLineNbr == childLine?.LineNbr).FirstOrDefault(); row.LocationID = childShipLine?.LocationID; } }
protected virtual void CurrencyList_RowUpdated(PXCache cache, PXRowUpdatedEventArgs e) { var row = e.Row as CurrencyList; if (row == null) { return; } if (CuryRecords.Cache.Current != null && row.IsFinancial != true) { CuryRecords.Cache.Delete(CuryRecords.Cache.Current); } if (row.IsFinancial == true && CuryRecords.Cache.Current != null && CuryRecords.Current.tstamp == null) { CuryRecords.Cache.Insert(CuryRecords.Cache.Current); } }
protected virtual void CRMarketingList_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { var row = e.Row as CRMarketingList; var oldRow = e.OldRow as CRMarketingList; if (row == null || oldRow == null) { return; } if (row.IsDynamic == true && row.IsDynamic != oldRow.IsDynamic && MailRecipients.Select(row.MarketingListID).Count > 0) { row.IsDynamic = false; sender.RaiseExceptionHandling <CRMarketingList.isDynamic>(e.Row, row.IsDynamic, new PXSetPropertyException(Messages.ThereAreManualSubscribers, PXErrorLevel.Warning)); } }
protected void FSBillingCycle_RowUpdated(PXCache cache, PXRowUpdatedEventArgs e) { if (e.Row == null) { return; } var newBillingCycleRow = (FSBillingCycle)e.Row; var oldBillingCycleRow = (FSBillingCycle)e.OldRow; if (newBillingCycleRow.BillingCycleType != oldBillingCycleRow.BillingCycleType || newBillingCycleRow.TimeCycleType != oldBillingCycleRow.TimeCycleType || newBillingCycleRow.TimeCycleDayOfMonth != oldBillingCycleRow.TimeCycleDayOfMonth || newBillingCycleRow.TimeCycleWeekDay != oldBillingCycleRow.TimeCycleWeekDay) { newBillingCycleRow.UpdateCutOffDate = true; } }
protected virtual void ARInvoice_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { var row = (ARInvoice)e.Row; if (row == null) { return; } ARInvoiceExt row1 = PXCache <ARInvoice> .GetExtension <ACUInsights.ARInvoiceExt>(row); if (row.RefNbr == " <NEW>") { row1.UsrInserted = "I"; } else { row1.UsrInserted = "U"; } }
protected virtual void Contact_RowUpdated(PXCache cache, PXRowUpdatedEventArgs e) { Contact cont = (Contact)e.Row; if (cont != null && cont.ContactType == ContactTypesAttribute.Employee && cache.ObjectsEqual <Contact.displayName>(e.Row, e.OldRow)) { BAccount emp = PXSelect <BAccount, Where <BAccount.parentBAccountID, Equal <Current <Contact.bAccountID> >, And <BAccount.defContactID, Equal <Current <CR.Contact.contactID> > > > > .SelectSingleBound(this, new object[] { cont }); if (emp != null) { emp = (BAccount)this.bAccountBasic.Cache.CreateCopy(emp); this.bAccountBasic.Cache.SetValueExt <EPEmployee.acctName>(emp, cont.DisplayName); this.bAccountBasic.Update(emp); } } }
public override void Parent_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { base.Parent_RowUpdated(sender, e); if (!sender.ObjectsEqual <POOrder.status, POOrder.cancelled>(e.Row, e.OldRow) || //There are two graphs when automation step with notification is getting applied. One of them (the one made by automation) will be //persisted, while another one is only displayed on the screen. Due to cache sharing and because of automatic screen refresh //we will get the same Status in e.Row and e.OldRow while in fact they are different (example - transition from NL Pending Email to NL Open step) (sender.Graph.UnattendedMode && (sender.Graph.AutomationStep != sender.Graph.AutomationStepOriginal))) { POOrder order = (POOrder)e.Row; PXCache plancache = sender.Graph.Caches[typeof(INItemPlan)]; bool Cancelled = (bool?)sender.GetValue <POOrder.cancelled>(e.Row) == true; foreach (INItemPlan plan in PXSelect <INItemPlan, Where <INItemPlan.refNoteID, Equal <Current <POOrder.noteID> > > > .Select(sender.Graph)) { if (Cancelled) { plancache.Delete(plan); } else { INItemPlan copy = PXCache <INItemPlan> .CreateCopy(plan); bool IsOnHold = IsOrderOnHold(order); string newPlanType; if (TryCalcPlanType(plan, IsOnHold, out newPlanType)) { plan.PlanType = newPlanType; } plan.Hold = IsOnHold; if (!string.Equals(copy.PlanType, plan.PlanType)) { plancache.RaiseRowUpdated(plan, copy); } plancache.MarkUpdated(plan); } } } }
protected virtual void BatchSelection_RowUpdated(PXCache cache, PXRowUpdatedEventArgs e) { Batch b = e.Row as Batch; if (b != null && b.Voided == false) { b.Scheduled = true; b.ScheduleID = Schedule_Header.Current.ScheduleID; } BatchSelection batch = e.Row as BatchSelection; if (batch != null && !string.IsNullOrWhiteSpace(batch.Module) && !string.IsNullOrWhiteSpace(batch.BatchNbr) && PXSelectorAttribute.Select <BatchSelection.batchNbr>(cache, batch) == null) { cache.RaiseExceptionHandling <BatchSelection.batchNbr>(batch, batch.BatchNbr, new PXSetPropertyException(Messages.BatchNbrNotValid)); Batch_Detail.Cache.Remove(batch); } }
protected virtual void SOOrder_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { var row = (SOOrder)e.Row; if (row == null) { return; } SOOrderExt row1 = PXCache <SOOrder> .GetExtension <ACUInsights.SOOrderExt>(row); if (row.OrderNbr == " <NEW>") { row1.UsrInserted = "I"; } else { row1.UsrInserted = "U"; } }
protected virtual void CRActivity_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { var row = e.Row as CRActivity; var oldRow = (CRActivity)e.OldRow; if (row == null || oldRow == null) { return; } if (row.UIStatus == ActivityStatusListAttribute.Completed) { row.PercentCompletion = 100; if (!object.Equals(sender.GetValueOriginal <CRActivity.uistatus>(row), ActivityStatusListAttribute.Completed)) { row.CompletedDate = PXTimeZoneInfo.Now; } } }
public void KCInventoryTrackingRule_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { if (e.Row == null) { return; } KCInventoryTrackingRule row = (KCInventoryTrackingRule)e.Row; KCSiteMaster siteMaster = Connection.SelectSingle(); if (siteMaster != null) { siteMaster.IncludeVendorInventory = row.IncludeVendorInventory; siteMaster.InventoryTrackingRule = row.InventoryTrackingRule; siteMaster.DefaultDistributionCenterID = row.DefaultDistributionCenterID; Connection.Update(siteMaster); } }
protected virtual void APPayment_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { PrintChecksFilter filter = Filter.Current; if (filter != null) { object OldRow = e.OldRow; if (ReferenceEquals(e.Row, e.OldRow) && !_copies.TryGetValue(e.Row, out OldRow)) { decimal?curyval = 0m; decimal?val = 0m; int? count = 0; foreach (APPayment res in APPaymentList.Select()) { if (res.Selected == true) { curyval += res.CuryOrigDocAmt ?? 0m; val += res.OrigDocAmt ?? 0m; count++; } } filter.CurySelTotal = curyval; filter.SelTotal = val; filter.SelCount = count; } else { APPayment old_row = OldRow as APPayment; APPayment new_row = e.Row as APPayment; filter.CurySelTotal -= old_row.Selected == true ? old_row.CuryOrigDocAmt : 0m; filter.CurySelTotal += new_row.Selected == true ? new_row.CuryOrigDocAmt : 0m; filter.SelTotal -= old_row.Selected == true ? old_row.OrigDocAmt : 0m; filter.SelTotal += new_row.Selected == true ? new_row.OrigDocAmt : 0m; filter.SelCount -= old_row.Selected == true ? 1 : 0; filter.SelCount += new_row.Selected == true ? 1 : 0; } } }
protected virtual void FSCustomerBillingSetup_RowUpdated(PXCache cache, PXRowUpdatedEventArgs e) { if (e.Row == null) { return; } var newCustomerBillingSetup = (FSCustomerBillingSetup)e.Row; var oldCustomerBillingSetup = (FSCustomerBillingSetup)e.OldRow; if (newCustomerBillingSetup.SrvOrdType != oldCustomerBillingSetup.SrvOrdType || newCustomerBillingSetup.BillingCycleID != oldCustomerBillingSetup.BillingCycleID || newCustomerBillingSetup.FrequencyType != oldCustomerBillingSetup.FrequencyType || newCustomerBillingSetup.Active != oldCustomerBillingSetup.Active) { FSxCustomer fsxCustomerRow = PXCache <Customer> .GetExtension <FSxCustomer>(Base.BAccount.Current); fsxCustomerRow.BillingOptionsChanged = true; } }
public void RowUpdated(PXCache cache, PXRowUpdatedEventArgs e) { var row = (SOPickerListEntry)e.Row; var oldRow = (SOPickerListEntry)e.OldRow; if (row.IsUnassigned == true) { return; } if (cache.ObjectsEqual <qty>(row, oldRow)) { return; } if (IsUnassignable(cache.Graph, row.InventoryID) == false) { return; } UpdateUnassigned(cache, row, oldRow.Qty - row.Qty); }
protected virtual void INPIClass_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { INPIClass row = e.Row as INPIClass; INPIClass oldrow = e.OldRow as INPIClass; if (row != null && oldrow != null) { if (row.ByFrequency == true && oldrow.ByFrequency != true) { row.ABCCodeID = null; row.MovementClassID = null; row.CycleID = null; } if (!PIMethod.IsByFrequencyAllowed(row.Method)) { row.ByFrequency = false; } } }
protected virtual void PMTask_RowUpdated(PXCache sender, PXRowUpdatedEventArgs e) { PMTask row = e.Row as PMTask; PMTask oldRow = e.OldRow as PMTask; if (row == null || oldRow == null) { return; } if (row.IsActive == true && oldRow.IsActive != true) { ActivateTask(row); } if (row.IsCompleted == true && oldRow.IsCompleted != true) { CompleteTask(row); } }
public static void CheckSOIfManualCost(PXCache cache, PXRowUpdatedEventArgs e) { if (e.Row == null && e.Row is FSSODet == false) { return; } var row = (FSSODet)e.Row; if ((e.ExternalCall || cache.Graph.IsImport) && cache.ObjectsEqual <FSSODet.branchID>(e.Row, e.OldRow) && cache.ObjectsEqual <FSSODet.inventoryID>(e.Row, e.OldRow) && cache.ObjectsEqual <FSSODet.uOM>(e.Row, e.OldRow) && cache.ObjectsEqual <FSSODet.siteID>(e.Row, e.OldRow) && cache.ObjectsEqual <FSSODet.manualCost>(e.Row, e.OldRow) && !cache.ObjectsEqual <FSSODet.curyUnitCost>(e.Row, e.OldRow)) { row.ManualCost = true; } }