Solved

To disable 'delete' in header document and enable 'delete' in line document

  • 5 October 2022
  • 5 replies
  • 409 views

Userlevel 4
Badge

Hello morning guys,

Is there a way to configure the access right by screen by disabling the delete button in header document and enabling the delete button in the line document? Is that possible?

The screen ID is CA304000.

Thank you in advance.

 

 

icon

Best answer by manikantad18 5 October 2022, 07:51

View original

5 replies

Userlevel 7
Badge +12

HI @chenwm 
 

 

Delete button revoked at the header level

 

Line Level document: I have given the insert rights at the line level so that we can restrict delete option

Thanks

Userlevel 4
Badge

 

 

Hi @manikantad18 

Thanks for the workaround. I managed to do it in the access right by screen.

 

 

 

 

 

Hello, is anyone able to provide more insight on this? I am looking to make a very similar change, but on Sales Orders and Purchase Orders screens rather than ‘Cash Entry’ screen.

 

I had my implementation company help with setting this up, however they set it so that “Delete” has been disabled across everything (both header and line-level). I would like to re-enable users to “Delete” at the line-level, but I cannot tell which Access Rights drop-down I should be selecting from, since the screenshots on this thread are cut-off. I have tried searching within these screens, but only seem to be able to find the “Delete” Access Right on the “Sales Orders” itself, not within the “Sales Orders Lines” (at the line-item level). I would like to learn how to do this in-house as our implementation company has not been the best recently. We are running on 2021R2 Build 21.216.0034

Knowing which Access Rights supersedes the others would help as well, as we have Access Rights customized across both Roles, Users, and now Screens as well.

Thank you all in advance.

Userlevel 5
Badge +2

Hello @mcginn!

I was able to accomplish this in the sales orders screen by setting access as follows.  I will start at the top level and work my way down.

 

 

 

 

With access to the Delete action set to Revoked at the Sales Order level, the user cannot delete the sales order, but can still delete rows from the Details tab.

 

Userlevel 2

We just hid the Actions more dynamically using a rowSelected Event 

namespace PX.Objects.AP
{
public class APInvoiceEntry_Extension : PXGraphExtension<PX.Objects.AP.APInvoiceEntry>
{
#region Event Handlers

protected void APInvoice_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
{
InvokeBaseHandler(cache, e);

var row = (APInvoice)e.Row;
var hideActions = false;
var hideApprovals = false;

foreach (UsersInRoles role in PXSelect<UsersInRoles, Where<UsersInRoles.username, Equal<Current<AccessInfo.userName>>>>.Select(Base))
{
if (role.Rolename == "Project Manager")
{
hideActions = true;
}
}

foreach (UsersInRoles role in PXSelect<UsersInRoles, Where<UsersInRoles.username, Equal<Current<AccessInfo.userName>>>>.Select(Base))
{
if (role.Rolename == "Project Accountant")
{
hideApprovals = true;
}
}

if (hideApprovals == true)
{
if (Base.Actions["approve"].IsNotNull())
{
Base.Actions["approve"].SetVisible(false);
}

if (Base.Actions["reject"].IsNotNull())
{
Base.Actions["reject"].SetVisible(false);
}
}

if (hideActions == true)
{
Base.Cancel.SetVisible(false);
Base.Next.SetVisible(false);
Base.First.SetVisible(false);
Base.Previous.SetVisible(false);
Base.Last.SetVisible(false);
Base.Insert.SetVisible(false);
Base.CopyPaste.SetVisible(false);
Base.putOnHold.SetVisible(false);
Base.releaseFromHold.SetVisible(false);
Base.release.SetVisible(false);
Base.payInvoice.SetVisible(false);
Base.editVendor.SetVisible(false);
Base.Delete.SetVisible(false);
Base.vendorDocuments.SetVisible(false);
Base.printAPEdit.SetVisible(false);
Base.printAPRegister.SetVisible(false);
Base.reclassifyBatch.SetVisible(false);
Base.createSchedule.SetVisible(false);
Base.recalculateDiscountsAction.SetVisible(false);
Base.reverseInvoice.SetVisible(false);
Base.Actions["releaseRetainage"].SetVisible(false);
Base.Actions["reclassify"].SetVisible(false);

if (Base.Actions["saveCloseToList"].IsNotNull())
{
Base.Actions["saveCloseToList"].SetVisible(false);
}

if (Base.Actions["cancelCloseToList"].IsNotNull())
{
Base.Actions["cancelCloseToList"].SetVisible(false);
}
}
}
#endregion
}
}

 

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