Can users have access to delete Customer Contacts without granting access to delete Customers?

It seems like when I remove the ability to delete a customer record (via Role Maintenance) it also removes the user's ability to delete the customer's contact records.

Is there any way around this so I can have users delete contacts but not customers? 

  • 0

    If you can't achieve this via Role Maintenance, you could use Custom Office to hide the Delete button on the AR maintenance panel.

  • 0 in reply to Leggett

    You can take this a step further by using a very simple script and either an inclusive or exclusive role assigned to users to control who can see/click the delete button in Customer Maintenance. 

    The biggest benefit of this approach is the elimination of a bunch of customized panels to maintain on a per user and/or company basis.

    First, determine whether it will be easier to create the role to be inclusive or exclusive.

    For example,

    If you have only one or a few users who should be able to delete a customer, then make the role so that only users who have the role assigned will see the button. 

    If you have only one or a few users who should not be able to delete a customer, than make the role so that only users who do not have the role assigned will see the button.

    Once you have created your role and named it appropriately and added it to the users, you can then create a script on the post read event of the AR_Customer table. Replace the "YourRoleName" with whatever name you use for the role. The script below uses the "Not()" function to hide the button if the current users is not a member of the role specified. If you remove "Not(" and the closing ")" then it will hide the button if the user is a member of the role specified. 

    Using scripts does require the "Allow External Access" checkbox is checked on the "Preferences" tab of "Company Maintenance".

     

    Here is the script.

    If oScript.UIObj > 0 Then
    If UCase(oSession.AsObject(oScript.UIObj).GetScreenName()) = UCase("AR_Customer.M4L") Then
    If Not(CBool(oSession.IsMember("YourRoleName"))) Then
    oSession.AsObject(oScript.UIObj).SetControlProperty "BT_Delete", "Visible", 0
    Else
    oSession.AsObject(oScript.UIObj).SetControlProperty "BT_Delete", "Visible", 1
    End If
    End If
    End If

  • 0 in reply to Leggett

    Thanks - I'm going to give this a try but when I got into custom office and look at Customer Maintenance's "DMAIN" panel I can only see buttons at the bottom for ACCEPT, CANCEL and OK. How do I get to the "DELETE" button? 

  • 0 in reply to Brett-AAG

    If i recall correctly, the DELETE button is under the OK button, if you right click it, you should get a prompt asking if you want the OK button, if you click No, it should then focus on the DELETE button. Which you can then set it to be either disabled or hidden on the last tab of the control's property window.