Search code examples
acumatica

How can I disable the Copy/Paste Save Template action?


Acumatica offers a great feature to Save as Template which makes creating new records from the template faster and easier. However, I have a use case where I need a more interactive sort of template in which the user can create a list of 100 items and then select which items to include when creating the new record.

In this case, the standard feature for Save as Template could be confusing, especially for new users learning the system. I have been asked to disable Save as Template on the Copy/Paste menu on my custom screen and transition to this new feature. I do not want to disable Copy/Paste entirely, just the Template functionality. If I disable Copy/Paste in Access Rights, the entire menu disappears. However, the template options do not appear in Access Rights.

Copy/Paste appears to be accessible via code as the PXAction CopyPaste which can be hidden or disabled, but again, I cannot find SaveTemplate as a child that I can control.

How can I disable/hide Save as Template (CopyPaste@SaveTemplate) on an Acumatica screen, either programmatically, in access rights, or in workflow? This menu is part of the standard Acumatica menu system when specifying a primary DAC when defining the graph. Alternatively, I think it enabled via the PXCopyPasteAction<> action if manually defining buttons on the page.


Solution

  • You can create your own PXCopyPasteAction by just extending the base class and then adding it to your graph

    quick example below

    public class CustomCopyPasteAction: PXCopyPasteAction<SOOrder>
            {
                public CustomCopyPasteAction(PXGraph graph, string name): base(graph, name) { }
    
                protected override void RowSelected(PXCache cache, PXRowSelectedEventArgs e)
                {
                    base.RowSelected(cache, e);
    
                    bmSaveTemplate.Enabled = false;
                }
            }