Skip to content

Instantly share code, notes, and snippets.

@smarenich
Created May 4, 2018 08:37
Show Gist options
  • Save smarenich/b4b08d61faf6cdf68fa76f99045a5de3 to your computer and use it in GitHub Desktop.
Save smarenich/b4b08d61faf6cdf68fa76f99045a5de3 to your computer and use it in GitHub Desktop.
using System;
using PX.Objects;
using PX.Data;
namespace PX.Data
{
public class LEPMaint_Extension : PXGraphExtension<LEPMaint>
{
#region Event Handlers
public PXAction<PX.Data.ListEntryPoint> ToggleActivation;
[PXButton(CommitChanges = true)]
[PXUIField(DisplayName = "Toggle Activation")]
protected void toggleActivation()
{
ListEntryPoint first = Base.Items.Select();
if(first != null)
{
bool val = !first.IsActive ?? false;
foreach(ListEntryPoint row in Base.Items.Select())
{
row.IsActive = val;
Base.Items.Update(row);
}
}
}
#endregion
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment