protected virtual void FARegister_DocDate_FieldUpdated(PXCache sender, PXFieldUpdatedEventArgs e) { FARegister reg = e.Row as FARegister; if (reg == null || reg.Origin != FARegister.origin.Adjustment) { return; } PXCache cache = sender.Graph.Caches <FATran>(); foreach (FATran tran in PXParentAttribute.SelectSiblings(cache, null, typeof(FARegister)).OfType <FATran>().Select(PXCache <FATran> .CreateCopy)) { tran.TranDate = reg.DocDate; cache.Update(tran); } }
private void updateOtherSiblings(PXCache sender, object row) { bool needRefresh = false; if (_parentAttribute == null) { return; } PXFieldState state = (PXFieldState)sender.GetStateExt(row, _FieldName); if (state.DataType != typeof(bool)) { return; } if ((bool?)sender.GetValue(row, _FieldName) == false) { return; } foreach (object sibling in PXParentAttribute.SelectSiblings(sender, row, _parentAttribute.ParentType)) { if (!sender.ObjectsEqual(sibling, row)) { if ((bool?)sender.GetValue(sibling, _FieldName) == true) { sender.SetValue(sibling, _FieldName, false); sender.Update(sibling); needRefresh = true; } } } if (needRefresh) { foreach (var kvp in sender.Graph.Views) { PXView view = kvp.Value; if (_BqlTable.IsAssignableFrom(view.GetItemType())) { view.RequestRefresh(); } } } }