public EPApprovalProcess()
        {
            Records.SetProcessCaption(EP.Messages.Approve);
            Records.SetProcessAllCaption(EP.Messages.ApproveAll);
            Records.SetSelected <EPOwned.selected>();
            Records.SetProcessDelegate(list => Approve(list, true));
            Records.ConfirmationTitle   = Messages.Approve;
            Records.ConfirmationMessage = Messages.ApproveAllConfirmation;
            this.Actions.Move(nameof(RejectAll), Records.ScheduleActionKey, true);

            this.Reject.StateSelectingEvents += new PXFieldSelecting(delegate(PXCache sender, PXFieldSelectingEventArgs e)
            {
                if (PXLongOperation.GetStatus(this.UID) != PXLongRunStatus.NotExists)
                {
                    e.ReturnState = PXButtonState.CreateInstance(e.ReturnState, null, null, null, null, null, false,
                                                                 PXConfirmationType.Unspecified, null, null, null, null, null, null, null, null, null, null, null, typeof(EPApproval));
                    ((PXButtonState)e.ReturnState).Enabled = false;
                }
            });
            this.RejectAll.StateSelectingEvents += new PXFieldSelecting(delegate(PXCache sender, PXFieldSelectingEventArgs e)
            {
                if (PXLongOperation.GetStatus(this.UID) != PXLongRunStatus.NotExists)
                {
                    e.ReturnState = PXButtonState.CreateInstance(e.ReturnState, null, null, null, null, null, false,
                                                                 PXConfirmationType.Unspecified, null, null, null, null, null, null, null, null, null, null, null, typeof(EPApproval));
                    ((PXButtonState)e.ReturnState).Enabled = false;
                }
            });
        }
        public GLConsolSetupMaint()
        {
            GLSetup setup = glsetup.Current;

            ConsolSetupRecords.SetProcessCaption(Messages.ProcSynchronize);
            ConsolSetupRecords.SetProcessAllCaption(Messages.ProcSynchronizeAll);
            ConsolSetupRecords.SetProcessDelegate <GLConsolSetupMaint>(Synchronize);
            PXUIFieldAttribute.SetEnabled(ConsolSetupRecords.Cache, null, true);
            PXUIFieldAttribute.SetEnabled <GLConsolSetup.lastPostPeriod>(ConsolSetupRecords.Cache, null, false);
            PXUIFieldAttribute.SetEnabled <GLConsolSetup.lastConsDate>(ConsolSetupRecords.Cache, null, false);
            ConsolSetupRecords.SetAutoPersist(true);
            ConsolSetupRecords.Cache.AllowDelete = true;
            ConsolSetupRecords.Cache.AllowInsert = true;

            PXUIFieldAttribute.SetRequired <GLConsolSetup.segmentValue>(ConsolSetupRecords.Cache, true);
            PXUIFieldAttribute.SetRequired <GLConsolSetup.sourceLedgerCD>(ConsolSetupRecords.Cache, true);

            Save.StateSelectingEvents += new PXFieldSelecting(delegate(PXCache sender, PXFieldSelectingEventArgs e)
            {
                e.ReturnState = PXButtonState.CreateInstance(e.ReturnState, null, null, null, null, null, false,
                                                             PXConfirmationType.Unspecified, null, null, null, null, null, null, null, null, null, null, null, null);
                ((PXButtonState)e.ReturnState).Enabled = !PXLongOperation.Exists(this.UID);
            });
        }