Skip to content

Instantly share code, notes, and snippets.

@smarenich
Created July 15, 2016 02:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smarenich/3052c93de78051c548908687f6f920cd to your computer and use it in GitHub Desktop.
Save smarenich/3052c93de78051c548908687f6f920cd to your computer and use it in GitHub Desktop.
public class MyGraph : PXGraph<MyGraph>
{
public MyGraph()
{
MainCommand.MenuAutoOpen = true;
MainCommand.AddMenuAction(SubCommand2);
MainCommand.AddMenuAction(SubCommand1);
}
public PXAction<UPCompany> MainCommand;
public PXAction<UPCompany> SubCommand1;
public PXAction<UPCompany> SubCommand2;
[PXButton(ImageKey = Sprite.Main.Process, Tooltip = "Sub Command 2 Tooltip")]
[PXUIField(DisplayName = "Sub Command 2", MapEnableRights = PXCacheRights.Delete, MapViewRights = PXCacheRights.Delete)]
protected IEnumerable subCommand1(PXAdapter adapter)
{
//Do sub command 2
return adapter.Get();
}
[PXButton(ImageKey = Sprite.Main.Process, Tooltip = "Sub Command 2 Tooltip")]
[PXUIField(DisplayName = "Sub Command 2", MapEnableRights = PXCacheRights.Delete, MapViewRights = PXCacheRights.Delete)]
protected IEnumerable subCommand2(PXAdapter adapter)
{
//Do sub command 2
return adapter.Get();
}
[PXButton(ImageKey = Sprite.Main.Process, Tooltip = "Main Command Tooltip")]
[PXUIField(DisplayName = "Main Command", MapEnableRights = PXCacheRights.Delete, MapViewRights = PXCacheRights.Delete)]
protected IEnumerable mainCommand(PXAdapter adapter)
{
return adapter.Get();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment