1

There are cases when a screen does not need to show Tools button, and i would like to hide it from the users with no administration roles.

I tried reading through the ASPX file, however i haven't found a clue.

1 Answers1

0

The feature you are looking for is not part of the base product and is out of reach of customization. To implement it properly you should make a feature request with Acumatica.

That being said, it is technically possible to edit the page directly on the server at this path:

\Controls\PageTitle.ascx.cs

You can edit page load event to add your condition for tools menu. As an example I have made Tools menu visible only for Administrator role:

if (!Page.IsCallback)
{
    Page.ClientScript.RegisterClientScriptBlock(GetType(), "toolbarNum", "var __toolbarID=\"" + this.tlbTools.ClientID + "\";", true);
    
    // >> Add Tools menu condition
    if (!PXContext.PXIdentity.User.IsInRole(PXAccess.GetAdministratorRoles().First()))
        this.tlbTools.Visible = false;
    // << Add Tools menu condition
}

It is technically possible to package this change in customization project by editing exclusion file list on server at this path:

/files.list

And remove the line for excluded file:

Controls\PageTitle.ascx.cs

After this you can add this modified file in customization project Files section.

Be warned that this is not recommended because it replaces base product file instead of customizing it. This means you must update (maintenance) this file in your customization each time it changes in next Acumatica versions.

If you don't need a customization to deploy the change you can skip that part and only manually edit the PageTitle file on server. Note that Acumatica updates might revert that change.

Hugues Beauséjour
  • 8,067
  • 1
  • 9
  • 22
  • 1
    technically, one can access the Page object using the current HttpRequest instance and apply the visible=false part right from the PXGraph – Samvel Petrosov Dec 09 '22 at 02:45
  • Interesting, this would help by eliminating maintenance of the original page. – Hugues Beauséjour Dec 09 '22 at 15:01
  • Dhirren did something like that here https://stackoverflow.com/questions/56582456/how-do-i-add-row-highlighting-to-a-customization-contained-within-a-base-acumati/65646249#65646249 – Samvel Petrosov Dec 09 '22 at 18:18