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?
Regards
Julia Gallegos
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?
Regards
Julia Gallegos
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:
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
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.....
Hi Derek, I couldn't find in FLS an option... maybe because it's not a button.
Thanks
Julia
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
André Arnaud de Cal...
292,516
Super User 2025 Season 1
Martin Dráb
231,432
Most Valuable Professional
nmaenpaa
101,156