Solved

How do you specify which Toolbar buttons are available on the toolbar or hidden under the three dots?


Userlevel 5
Badge +1

On the Purchase Receipts form we have two buttons in the toolbar at the top, ITEM SPECS and ITEM BARCODE LABELS.  We don’t need them to be visible at all times.  How do we hide them under the three dots menu? Does this require a customization or am I missing something obvious? 

 

Thanks for any help,

 

Phil

icon

Best answer by aaghaei 29 March 2023, 22:57

View original

8 replies

Userlevel 7
Badge +17

Hi @ppowell  If you do not want to show the buttons on the Toolbar, you can uncheck the “Duplicate on Toolbar” checkbox in the Workflow steps in the Customization project. 

Please find the screenshot for reference.

 

Userlevel 6
Badge +4

Even in older versions of Acumatica, you have to add the action to the menu to get it to tuck under the Actions or Inquiry menu instead of dropping directly on the menu bar.  In this regard, the behavior in 2022R1 still requires adding to the menu, although it is a very different methodology than before.

Assuming that these are custom actions, you need to add them to a workflow.  While Naveen shows a screenshot of doing workflow in the GUI of Customization Project, I have a 5 part series on my blog post about workflow for those starting to learn how to code them in C#.  The 2nd part specifically outlines the basics of adding actions.  Workflow via Code – Part 2  While you can get pretty complex on how you setup the action in workflow (when to show/hide or enable/disable, where to place in order, etc.) the most important thing is to add the action to the workflow.  Once on the menu, you can mark “Duplicate On Toolbar” as shown in examples on the blog post (or not), but also note that the user also can “star” them to make them pop out as well.  However, once added to the workflow as actions, they will appear on the 3 dots menu and these other options simply add a duplicate button on the toolbar for quick access.

Here’s a simple graph extension to add a button for the custom RecordOutages action to the Sales Order screen’s menu.

using PX.Data;
using PX.Data.WorkflowAPI;
using SSCS;

namespace PX.Objects.SO.Workflow.SalesOrder
{
    public class SOOrderEntry_Workflow_SSCS : PXGraphExtension<SOOrderEntry>
    {
        public static bool IsActive() =>
            SSCSAccess.FeatureInstalled<SSCSFeaturesSet.main>();

        #region Initialization
        public override void Configure(PXScreenConfiguration config)
        {
            Configure(config.GetScreenConfigurationContext<SOOrderEntry, SOOrder>());
        }

        protected virtual void Configure(WorkflowContext<SOOrderEntry, SOOrder> context)
        {
            context.UpdateScreenConfigurationFor(screen =>
            {
                return screen
                    .WithActions(actions =>
                    {
                        actions.Add<SOOrderEntry_Extension>(g => g.RecordOutage, a => a.WithCategory(PredefinedCategory.Actions));
                    });
            });
        }
        #endregion

    }
}

 

You’ll notice that it doesn’t do anything fancy, but this will extend the existing graph and update the existing workflow to add the custom menu item.  For more information on workflow including how to write one from scratch for a custom screen, you can refer to my blog post linked above.  I also encourage you to review the new workflow training course T270 on Acumatica’s Open University.

Userlevel 5
Badge +1

Thanks both for your suggestions.  Unfortunately the buttons weren’t defined in the Workflow and I think the code thing is overkill for this one though very useful to know for future reference.  Thanks so much for your detailed reply.

 

In this case they were defined as Actions in the Customization Project and Add to Toolbar was checked.

 

Your replies did help me to think about were they might be defined so I really appreciate both of your answers as it helped me narrow down where the option is.

 

Thanks both for your suggestions.  Unfortunately the buttons weren’t defined in the Workflow and I think the code thing is overkill for this one though very useful to know for future reference.  Thanks so much for your detailed reply.

 

In this case they were defined as Actions in the Customization Project and Add to Toolbar was checked.

 

Your replies did help me to think about were they might be defined so I really appreciate both of your answers as it helped me narrow down where the option is.

 

What version of Acumatica is this? I’m on 22R1 and I do not see the “Add to Toolbar” option in actions. Instead, I am forced to adjust the button through each state of each workflow.

Userlevel 5
Badge +1

@epetruncio89 We haven’t moved to 22R1 yet.  Still on 21R2. However I just had a look at our 22r1 sandbox setup and there seems to be an option for Display on Toolbar which has a Hide option.  It warns me that if the Duplicate to Toolbar checkbox is checked in the workflow it will still display though. 

Not sure if that helps but it seems to be the equivalent option for whether it shows on the toolbar at first glance,

 

Phil

That option completely hides it from both the tool bar and the ellipsis. Looks like they took out that option to set show on toolbar from the action in later versions. Not sure why.

Userlevel 7
Badge +8

if you want conditionally show/hide a button,

1) add a condition to that screen and define your conditions

2) from the Actions, select your desired Action and set its Visibility to your Condition

 

Or alternatively, you can control Action Buttons visibility in RowSelected Event.

 

Please note if a user has added that action to the favorites, I have seen it always become visible no matter what you do. I created a ticket for it a long time ago but have not received any update on it.

aaghaei,

I believe this still shows or hides the button period, not just remove from toolbar into the ellipsis. I’ve used this and just set it to false and I was unable to see the action completely. If I am incorrect, please let me know. I’m not looking to completely remove the action. I just want the action to not be visible on the toolbar for all states and workflows. The problem is that we cannot (as far as I know) do that via code outside of a workflow now.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved