27 August, 2010

Disable DELETE PO in Dynamics GP Purchase Order Entry

The question; "Is there a way to turn off the DELETE option for POs?" came up in the newsgroups recently.  If you need to, here's a pretty simple way to do so.
  1. Add the Purchase Order Entry Window to Visual Basic.
  2. Add the following code to the Window_BeforeModalDialog event:
If PromptString = "Are you sure you want to delete this record?" Then

    Answer = dcButton2
    Response = MsgBox("You are not allowed to Delete Purchase Orders.", vbOKOnly, "Microsoft Dynamics GP")
End If

Now, instead of prompting to confirm that you want to Delete a PO after selecting Delete from the Actions Button the system will prompt you that you cannot and cancel that action.

No comments: