0

We have a requirement to add a new “Back Button” to the existing screen i.e. Preowned Vehicles Returns. I have added the "Back Button" button but it is coming at last, we would like to move this button before the Save action.

Could you please provide your thoughts here?

enter image description here

Naveen B
  • 55
  • 4
  • Could you simply override a currently existing button instead? – Deetz Oct 13 '20 at 13:54
  • The order of the buttons on the graph is based on the order of the PXAction in your graph: https://stackoverflow.com/a/48672995/2056380 also you can do as the answer provided in a graph extension if your graph is an extension. Is this a custom graph (not a graph extension) and if so how are you declaring your buttons/pxactions? – Brendan Oct 22 '20 at 15:49

1 Answers1

0

Is it possible to use a graph extension to move the button? You can override Initialize() in your graph extension and use Actions.Move() to move an action button after another action button. I'm not sure if there's a method that places a button before another but you can move them twice. For example: If you want to move 3 before 1 in [1, 2, 3], you can place 3 immediately after 1, then place 1 immediately after 3.

public class GraphExtension : PXGraphExtension<BaseGraph>
{
    public override void Initialize()
    {
        base.Initialize();
        Base.Actions.Move(nameof(Base.Save), nameof(Base.BackButton), true);
        Base.Actions.Move(nameof(Base.BackButton), nameof(Base.Save), true);
    }
}

Before swapping buttons

becomes

After swapping buttons

Djinn
  • 663
  • 5
  • 12