#GPPT Preventing Inserting and Deleting of Sales Transaction Lines

David Meego - Click for blog homepageI was recently asked how to use GP Power Tools to prevent users from Inserting or Deleting lines from the Sales Transaction Entry (SOP_Entry) window.

It is a really simple customization so I thought I would post it as a sample for your reference.

We start as usual by creating a project to contain all the components of the customization.

Then we can create a focus event trigger before the scroll insert of the Line_Scroll window in the SOP_Entry form.

The actions are set to display a warning message in a simple dialog and to issue a Reject Script command to prevent the original GP code from running.

The script just needs to set the OUT_Condition=true to make the actions run each time the trigger is fired.

This trigger is then duplicated and adjusted to handle the Scroll Delete event to prevent deleting of a line.

The final piece of the puzzle is to prevent a line being deleted from the Sales Item Detail Entry window. We just need to add one more trigger before the Field Change event of the Delete Button on the SOP_Item_Detail window of the SOP_Item_Detail form with the same actions and script.

Finally, from the Project Setup window, you can use the Update Triggers Button to Mark All as Minimize Logs (if they are not already) and to Mark All as Automatic Start to make the code active.

Downloading and Installing

Download the example code, import using the Project Setup window (now possible for first time imports with Build 28.8 onwards), or use Configuration Export/Import window (for older builds):

The code will be active on next login or after switching companies, or you can use start them manually from the Project Setup window.

More Information

For more information see:


This article was originally posted on http://www.winthropdc.com/blog.

Please post feedback or comments

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.