Skip to main content
Solved

Custom Actions - Add to Action Menu - ARInvoiceEntry vs. APInvoiceEntry / JournalEntry


Hi,

I have extension classes for the ARInvoiceEntry, APInvoiceEntry and JournalEntry, each has a action button called “ChangeSomeField”, which needs to be on the Action Menu.

For ARInvoiceEntry, the base class has an ActionsMenuItem.AddMenuAction() which I can use to add the action to the action menu.  From what I can see in the code this is because they ARDataEntryGraph which implements the IActionsMenuGraph.

For both APInvoiceEntry and JournalEntry, from what I can see they’re base classes do not implement this interface which means I can’t access the ActionsMenuItem.AddMenuAction() to add the actions to the action menu.

In APInvoiceEntry and JournalEntry extension classes, how do I add custom actions to the action menu?  Do I need to implement that IActionsMenuGraph myself on my extension classes or is there another way.  Could I please have an example if either of the above two are correct?

Best answer by rualdventer64

Hi, for APInvoiceEntry and JournalEntry I was able to add the custom action to the Actions menu using the screen editor as below.

 

 

View original
Did this topic help you find an answer to your question?

4 replies

Forum|alt.badge.img+4

What version of Acumatica are you on?  Older versions are added via AddMenuAction, but more recent releases have converted to the new workflow engine.  If you check the code repository and find a file called ARInvoiceEntry_Workflow.cs in the PX.Objects/AR folder, then you will know you are on the new workflow engine.

In the new workflow engine, here is the simple version of adding an action to the 3 dots menu via code.  Workflow gets significantly more complex beyond this, but this example where I simply added a an action to Sales Order should get you started.  My version is 2022R1, which is slightly different than 2021R2.

 

using PX.Data;
using PX.Data.WorkflowAPI;
namespace PX.Objects.SO.Workflow.SalesOrder
{
    public class SOOrderEntry_Workflow_SSCS : PXGraphExtension<SOOrderEntry>
    {
        public static bool IsActive() => // Insert IsActive code here


        #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

    }
}
 


  • Author
  • Freshman II
  • 3 replies
  • June 22, 2022

On 2021 R2, build is 21.118.0038


  • Author
  • Freshman II
  • 3 replies
  • Answer
  • June 24, 2022

Hi, for APInvoiceEntry and JournalEntry I was able to add the custom action to the Actions menu using the screen editor as below.

 

 


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • 2754 replies
  • June 24, 2022

Thank you for sharing your solution @rualdventer64 !


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings