How to Move Customized Action/Button place in existing screen

157 views Asked by At

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

1

There are 1 answers

0
Djinn On

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