Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested answer

GP2018 Security-Lock delete option

(0) ShareShare
ReportReport
Posted on by

Hi,

    I need to lock the delete option in the screen Stock Count Schedule, but the menu options appears with right-click button... any idea?

pastedimage1648601317969v1.png

Regards

Julia Gallegos

Categories:
  • Suggested answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    14,036 Most Valuable Professional on at
    RE: GP2018 Security-Lock delete option

    I am the original creator and developer of Field Level Security.

    It is not capable of preventing the Edit >> Delete Row or right click >> Delete Row option and cannot capture the "Are you sure" modal dialog.

    However, GP Power Tools - Developer Tools module can prevent the Delete Row event entirely.  While it can also intercept the modal dialog (something Dexterity natively cannot do), it would not be needed if you just abort the Delete Row event before it happens.

    See this similar example:

    winthropdc.wordpress.com/.../

    What you want can be created in a few minutes with GP Power Tools and would not need any separate development tools, no deployment steps and no upgrading when you change GP version.

    If you start a trial period, I would be happy to help you create the code you need with a conference call.

    Kind regards

    David Musgrave

    Original Developer of Field Level Security

  • Suggested answer
    Derek Albaugh Profile Picture
    on at
    RE: GP2018 Security-Lock delete option

    I've mentioned this on cases where the customer was looking to disable the DELETE button on a GP window before but having issues with it.......I don't know if it's the exact same thing as what you're running into, but thought I'd mention it, just in case, as it is similar.......

    This prompt is a system dialog and is not a Dexterity form. Even though the dialog box can be created from Dexterity, you cannot address, trigger, or control this kind of dialog from Dexterity. Therefore, Dexterity and Field Level Security cannot control system dialogs. (Field Level Security is written in Dexterity.)

    From what I’ve found and understand, the only alternatives are to either use a Dexterity Trigger on the Delete_Record form level procedure or use the Delete Record field script to stop the Delete.

    The other option is to use the Window_BeforeModalDialog() event in Microsoft VBA to always answer Cancel when the users are prompted with the system dialog and to then disable the Delete button.

    For example, using VBA, I added the Payables Transaction Entry window to the Visual Basic Editor, then in VBA, for this window, I went under the Window.BeforeModalDialog event and added the following code:

    Private Sub Window_BeforeModalDialog(ByVal DlgType As DialogType, PromptString As String, Control1String As String, Control2String As String, Control3String As String, Answer As DialogCtrl)

    'Verify which modal dialog is currently displayed

    If PromptString = "Do you want to save changes?" Then

    'Close dialog window by selecting the Cancel button

    Answer = dcButton3

    End If

    End Sub

    Saving changes and going back into Dynamics GP, if I create a new transaction I’m able to save it, or if I make changes to an existing transaction I can save it.

    However, if I make a change to an existing PM transaction and then click the X to close the window without clicking Save, it won’t close the window because the VBA code is triggering the ‘Cancel’ button with the dcButton3 value, so the user cannot use the Delete option through this dialog box.

    dcButton2 indicates the Delete button and dcButton1 is the Save button in this dialog box, so you could set it as you wish.

    You can try this and see if it works for you.......others in the Community may have better options.......

    I just wanted to mention it, in case it helps.....

  • Julia_Gallegos Profile Picture
    on at
    RE: GP2018 Security-Lock delete option

    Hi Derek, I couldn't find in FLS an option... maybe because it's not a button.

    Thanks

    Julia

  • Suggested answer
    Derek Albaugh Profile Picture
    on at
    RE: GP2018 Security-Lock delete option

    I'd usually say Field Level Security, but as it is an option that appears when you right-click on the form or field, I'm not completely sure FLS would be able to handle it, which is what you mentioned as well.

    Besides FLS, you'd be looking at some type of customization whether through a .NET/VB modification or Dexterity customizations.

    Hopefully someone in the Community will have some experience similar to this type of modification, that they can share.....

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 601 Most Valuable Professional

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 416

#3
Adis Profile Picture

Adis 384 Super User 2025 Season 1

Product updates

Dynamics 365 release plans